-
Notifications
You must be signed in to change notification settings - Fork 448
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
[WIP] TPC QC: adds Cluster occupancy histograms #12643
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -17,10 +17,10 @@ | |||||
#ifndef AliceO2_TPC_CLUSTERS_H | ||||||
#define AliceO2_TPC_CLUSTERS_H | ||||||
|
||||||
//root includes | ||||||
// root includes | ||||||
#include "TCanvas.h" | ||||||
|
||||||
//o2 includes | ||||||
// o2 includes | ||||||
#include "TPCBase/CalDet.h" | ||||||
#include "TPCBase/Sector.h" | ||||||
#include "DataFormatsTPC/Defs.h" | ||||||
|
@@ -49,9 +49,9 @@ class Clusters | |||||
|
||||||
void fillADCValue(int cru, int rowInSector, int padInRow, int timeBin, float adcValue); | ||||||
|
||||||
void normalize(); | ||||||
void normalize(const float nHBFPerTF = 128); | ||||||
|
||||||
inline void analyse() { Clusters::normalize(); } | ||||||
inline void analyse() { Clusters::normalize(); } // deprecated | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be used in macros, so I would not call it deprecated.
Suggested change
|
||||||
|
||||||
void denormalize(); | ||||||
|
||||||
|
@@ -61,19 +61,24 @@ class Clusters | |||||
|
||||||
void dumpToFile(std::string filename, int type = 0); | ||||||
|
||||||
void setnHBFperTF(float nHBFPerTF){ | ||||||
mNHBFperTF = nHBFPerTF; | ||||||
} | ||||||
const CalPad& getNClusters() const { return mNClusters; } | ||||||
const CalPad& getQMax() const { return mQMax; } | ||||||
const CalPad& getQTot() const { return mQTot; } | ||||||
const CalPad& getSigmaTime() const { return mSigmaTime; } | ||||||
const CalPad& getSigmaPad() const { return mSigmaPad; } | ||||||
const CalPad& getTimeBin() const { return mTimeBin; } | ||||||
const CalPad& getOccupancy() const { return mOccupancy; } | ||||||
|
||||||
CalPad& getNClusters() { return mNClusters; } | ||||||
CalPad& getQMax() { return mQMax; } | ||||||
CalPad& getQTot() { return mQTot; } | ||||||
CalPad& getSigmaTime() { return mSigmaTime; } | ||||||
CalPad& getSigmaPad() { return mSigmaPad; } | ||||||
CalPad& getTimeBin() { return mTimeBin; } | ||||||
CalPad& getOccupancy() { return mOccupancy; } | ||||||
|
||||||
void endTF() { ++mProcessedTFs; } | ||||||
|
||||||
|
@@ -86,8 +91,10 @@ class Clusters | |||||
CalPad mSigmaTime{"Sigma_Time"}; | ||||||
CalPad mSigmaPad{"Sigma_Pad"}; | ||||||
CalPad mTimeBin{"Time_Bin"}; | ||||||
CalPad mOccupancy{"Occupancy"}; | ||||||
size_t mProcessedTFs{0}; | ||||||
bool mIsNormalized{false}; | ||||||
float mNHBFperTF{128}; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default now it
Suggested change
|
||||||
|
||||||
ClassDefNV(Clusters, 1) | ||||||
}; | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -22,8 +22,10 @@ | |||||
#include "TPCBase/ROC.h" | ||||||
#include "TPCBase/CRU.h" | ||||||
#include "TPCBase/Mapper.h" | ||||||
#include "TPCBase/ParameterElectronics.h" | ||||||
#include "DataFormatsTPC/ClusterNative.h" | ||||||
#include "DataFormatsTPC/KrCluster.h" | ||||||
#include "CommonConstants/LHCConstants.h" | ||||||
|
||||||
ClassImp(o2::tpc::qc::Clusters); | ||||||
|
||||||
|
@@ -107,7 +109,7 @@ void Clusters::fillADCValue(int cru, int rowInSector, int padInRow, int timeBin, | |||||
} | ||||||
|
||||||
//______________________________________________________________________________ | ||||||
void Clusters::normalize() | ||||||
void Clusters::normalize(const float nHBFPerTF) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
{ | ||||||
if (mIsNormalized) { | ||||||
return; | ||||||
|
@@ -119,7 +121,11 @@ void Clusters::normalize() | |||||
mSigmaPad /= mNClusters; | ||||||
mTimeBin /= mNClusters; | ||||||
|
||||||
mOccupancy = mNClusters; | ||||||
mOccupancy /= float(mProcessedTFs * (o2::constants::lhc::LHCMaxBunches * nHBFPerTF) / float(o2::tpc::ParameterElectronics::TIMEBININBC)); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
mIsNormalized = true; | ||||||
mOccupancy.setName("Occupancy"); | ||||||
} | ||||||
|
||||||
//______________________________________________________________________________ | ||||||
|
@@ -134,6 +140,7 @@ void Clusters::denormalize() | |||||
mSigmaTime *= mNClusters; | ||||||
mSigmaPad *= mNClusters; | ||||||
mTimeBin *= mNClusters; | ||||||
mOccupancy = mNClusters; | ||||||
|
||||||
mIsNormalized = false; | ||||||
} | ||||||
|
@@ -171,12 +178,13 @@ void Clusters::merge(Clusters& clusters) | |||||
mSigmaTime += clusters.mSigmaTime; | ||||||
mSigmaPad += clusters.mSigmaPad; | ||||||
mTimeBin += clusters.mTimeBin; | ||||||
mProcessedTFs += clusters.mProcessedTFs; | ||||||
|
||||||
if (isThisNormalized) { | ||||||
normalize(); | ||||||
normalize(mNHBFperTF); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed, use internal member.
Suggested change
|
||||||
} | ||||||
if (isOtherNormalized) { | ||||||
clusters.normalize(); | ||||||
clusters.normalize(mNHBFperTF); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
} | ||||||
|
||||||
|
@@ -196,6 +204,7 @@ void Clusters::dumpToFile(std::string filename, int type) | |||||
f->WriteObject(o2::tpc::painter::draw(mSigmaTime), mSigmaTime.getName().data()); | ||||||
f->WriteObject(o2::tpc::painter::draw(mSigmaPad), mSigmaPad.getName().data()); | ||||||
f->WriteObject(o2::tpc::painter::draw(mTimeBin), mTimeBin.getName().data()); | ||||||
f->WriteObject(o2::tpc::painter::draw(mOccupancy), mOccupancy.getName().data()); | ||||||
f->Close(); | ||||||
} | ||||||
|
||||||
|
@@ -209,6 +218,7 @@ void Clusters::dumpToFile(std::string filename, int type) | |||||
f->WriteObject(&mSigmaTime, mSigmaTime.getName().data()); | ||||||
f->WriteObject(&mSigmaPad, mSigmaPad.getName().data()); | ||||||
f->WriteObject(&mTimeBin, mTimeBin.getName().data()); | ||||||
f->WriteObject(&mOccupancy, mOccupancy.getName().data()); | ||||||
nTFs.Write(); | ||||||
f->Close(); | ||||||
} | ||||||
|
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.
There is a data member for the number of HBFs. So it is not needed twice