New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run2-alca99 Modify all macros used to calibrate Hcal using IsoTracks #20608
Conversation
The code-checks are being triggered in jenkins. |
+code-checks |
A new Pull Request was created by @bsunanda for master. It involves the following packages: Calibration/HcalCalibAlgos @ghellwig, @arunhep, @cerminar, @cmsbuild, @franzoni, @lpernie can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no major concerns, just address my minor comments
unsigned int correctDetId(unsigned int detId); | ||
|
||
static const unsigned int nmax_=10; | ||
bool debug_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to make this const as this is known already at construction time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
unsigned int getDetId(int subdet, int ieta, int iphi, int depth); | ||
unsigned int correctDetId(unsigned int detId); | ||
|
||
static const unsigned int nmax_=10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make this constexpr (although it likely doesn't matter much in a ROOT macro)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try constexpr in ROOT macro with cint - it does not work for 5.45
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not work for 5.26
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, if the macro has to cover several root versions, it's fine, but why do you use such an old version?
the default one is ROOT 6 in 94X
|
||
void CalibCorr::readCorr(const std::string& infile) { | ||
|
||
std::ifstream fInput(infile.c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please drop .c_str()
as there is also a constructor taking directly the std::string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has to work for ROOT 5.26 as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question as above: why do you need it for ROOT 5.26?
unsigned int id_ = ((4<<28)|((subdet&0x7)<<25)); | ||
id_ |= ((0x1000000) | ((depth&0xF)<<20) | | ||
((ieta>0)?(0x80000|(ieta<<10)):((-ieta)<<10)) | | ||
(iphi&0x3FF)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these magic numbers documented somewhere?
ieta = ((detId >> 10) & 0x1FF); | ||
zside = (detId&0x80000)?(1):(-1); | ||
depth = ((detId >> 20) & 0xF); | ||
iphi = (detId & 0x3FF); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
double fact0, fact1, fact2; | ||
}; | ||
|
||
CalibTree(const char *dupFileName, std::string rcorFileName, bool flag, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use const std::string&
|
||
void Run(const char *inFileName, const char *dirName, const char *treeName, | ||
const char *outFileName, const char *corrFileName, | ||
const char *dupFileName, const std::string rcorFileName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use const std::string&
CalibTree::~CalibTree() { | ||
if (cFactor_) delete cFactor_; | ||
if (!fChain) return; | ||
delete fChain->GetCurrentFile(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
<< std::endl; | ||
} | ||
|
||
for (std::map<unsigned int,TH1D*>::iterator itr = histos.begin(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be a const_iterator
, right?
or use auto
together with cbegin()
applies also to iterators below
if (truncateFlag_) { | ||
if ((subdet == 1) && (ieta > 14)) depth = 1; | ||
} | ||
id = (subdet<<25) | (0x1000000) | ((depth&0xF)<<20) | ((zside>0)?(0x80000|(ieta<<10)):(ieta<<10)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic numbers
please test |
The tests are being triggered in jenkins. |
The code-checks are being triggered in jenkins. |
+code-checks |
please test |
The tests are being triggered in jenkins. |
The code-checks are being triggered in jenkins. |
@cmsbuild Please test |
+code-checks |
The tests are being triggered in jenkins. |
+1 The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @davidlange6, @slava77, @smuzaffar (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
No description provided.