Skip to content
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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions Detectors/TPC/qc/include/TPCQC/Clusters.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Copy link
Collaborator

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

Suggested change
void normalize(const float nHBFPerTF = 128);
void normalize();


inline void analyse() { Clusters::normalize(); }
inline void analyse() { Clusters::normalize(); } // deprecated
Copy link
Collaborator

Choose a reason for hiding this comment

The 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
inline void analyse() { Clusters::normalize(); } // deprecated
inline void analyse() { Clusters::normalize(); }


void denormalize();

Expand All @@ -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; }

Expand All @@ -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};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default now it 32

Suggested change
float mNHBFperTF{128};
float mNHBFperTF{32};


ClassDefNV(Clusters, 1)
};
Expand Down
16 changes: 13 additions & 3 deletions Detectors/TPC/qc/src/Clusters.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -107,7 +109,7 @@ void Clusters::fillADCValue(int cru, int rowInSector, int padInRow, int timeBin,
}

//______________________________________________________________________________
void Clusters::normalize()
void Clusters::normalize(const float nHBFPerTF)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void Clusters::normalize(const float nHBFPerTF)
void Clusters::normalize()

{
if (mIsNormalized) {
return;
Expand All @@ -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));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mOccupancy /= float(mProcessedTFs * (o2::constants::lhc::LHCMaxBunches * nHBFPerTF) / float(o2::tpc::ParameterElectronics::TIMEBININBC));
mOccupancy /= float(mProcessedTFs * (o2::constants::lhc::LHCMaxBunches * mNHBFPerTF) / float(o2::tpc::ParameterElectronics::TIMEBININBC));


mIsNormalized = true;
mOccupancy.setName("Occupancy");
}

//______________________________________________________________________________
Expand All @@ -134,6 +140,7 @@ void Clusters::denormalize()
mSigmaTime *= mNClusters;
mSigmaPad *= mNClusters;
mTimeBin *= mNClusters;
mOccupancy = mNClusters;

mIsNormalized = false;
}
Expand Down Expand Up @@ -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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed, use internal member.

Suggested change
normalize(mNHBFperTF);
normalize();

}
if (isOtherNormalized) {
clusters.normalize();
clusters.normalize(mNHBFperTF);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
clusters.normalize(mNHBFperTF);
clusters.normalize();

}
}

Expand All @@ -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();
}

Expand All @@ -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();
}
Expand Down
Loading