TRD and TPC constants in subsidiary namespace#4124
Conversation
|
Hi @martenole You want to pull all the stuff from FeeParam, Geometry and TRDSimParam ? It was discussed at one point, I dont remember why it stalled. |
|
Hi Sean, Yes, I would take anything from the classes you mention which is used in various places. Definitely the geometrical constants of FeeParam, but not for example variables like kNPadsInPadResponse of the TRDSimParam, since this is specific to the simulation. And all the detailed definitions in TRDGeometryBase I would also leave untouched, because I would say this is the natural place for them. |
|
Hi Ole
I see there is a mgkNrowC1, MAXROWS, ROWMAXC1, maybe more than just my opinion is needed here. |
|
This is not urgent, I want to wait for Jorge to see if he sees anything that speaks against this. Exactly, all mgk... but the LHC frequency which is already defined in LHCConstants.h ;) For the number of rows per chamber we just need to choose a naming convention. Maybe NROWSC0 (12 rows in stack 2) and NROWSC1 (16 rows everywhere else) is best. |
|
Hello @martenole, this will improve the code a lot. It happens to me that many times I am using the same constant from several places, for example, with |
|
Hi @davidrohr |
|
I think technically there is not really a difference and so far some detectors use the one and others use the other way. I think at some point there was a discussion to limit the nested level of namespaces, so if in doubt I would use a class, but it doesn't really matter. |
I am wondering about this and the wish to reduce keyboard wear: I guess with a namespace one could do But my typing might have already created more keyboard wear than that ;-) I'm happy either way. |
tdietel
left a comment
There was a problem hiding this comment.
See my comment, otherwise I'm happy.
27f860b to
2832c48
Compare
|
After talking to @davidrohr the variables are now put in a namespace instead of a class. Will do the same for the TPC constants now in an additional commit. |
That's great! Just out of curiosity, did you discuss some technicalities for using a namespace rather than a class? |
Not really.. We think that technically there is probably no difference, 3 levels of namespaces should be fine and Tom had a good point with less typing when one puts a |
davidrohr
left a comment
There was a problem hiding this comment.
This looks better to me now, and it is less typing than before.
Will you squash the cleanup commit into the TRD commit, or do you want me to squash anything when merging? I believe the errors are unrelated.
|
Yes. Errors are unrelated. @knopers8 can you look at them? These are with 1.0.2. |
|
Hi @davidrohr |
|
@martenole : Nicely spotted, QC was failing all the time for unrelated reasons, so I ignored it... |
|
I would advocate doing it in gentle steps without breaking the builds, but if it is not possible here, then sure, I can help you. |
|
We could do everything in QC with an #ifdef first, support both versions, then switch in O2, then remove the stuff in QC. But since everything requires also an alidist bump, that will be quite annoying, so I'd rather do it quickly in one go. |
|
OK, let me know when you are ready |
BTW, QC was failing yesterday because we were in progress of doing the same exact thing, but for EMCal-related code. So you can see the amount of chaos it introduces. |
|
@martenole : I think we can avoid it this way: We can just provide the old Constants as an alias for a short time until we update QC? |
|
Hi @davidrohr |
|
Hi @shahor02 and @wiechula |
|
@martenole : Thx for the work, can you open a corresponding PR for QC as well? |
|
@davidrohr Thanks for merging, PR for QC is here: AliceO2Group/QualityControl#459 |
|
Thanks for finding a way to make it smooth! |
Hi @jolopezl @bazinski and @tdietel
I was going through the TRD code in O2 and noticed that some fixed constants of the TRD (Nlayers, Nstacks, ...) are defined quite often in different header files. Shall we collect these constants and add them to a separate header file? The TPC is doing the same and it would make our code more readable I think.
I could replace all obsolete definitions, but I don't want to mess around with the same files that you are working on. Please let me know what you think.
Cheers,
Ole