Skip to content

Commit

Permalink
Please consider the following formatting changes (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
alibuild authored Oct 23, 2024
1 parent 4882cfc commit 3b36d1f
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 40 deletions.
10 changes: 5 additions & 5 deletions Detectors/ZDC/calib/include/ZDCCalib/InterCalibConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ struct InterCalibConfig {
// the same as for ZPA/ZPC with no cuts
double xcut_ZPA = 0;
double xcut_ZPC = 0;
double rms_cut_ZP = 0; // RMS of ZP centroid can go from 0 to 8.4 cm
double towerCutLow_ZPA[4] = { 0, 0, 0, 0}; // Applied to all ZP fits except ZPI
double towerCutLow_ZPC[4] = { 0, 0, 0, 0}; // Applied to all ZP fits except ZPI
double towerCutHigh_ZPA[4] = { std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity() }; // Applied to all ZP fits except ZPI
double towerCutHigh_ZPC[4] = { std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity() }; // Applied to all ZP fits except ZPI
double rms_cut_ZP = 0; // RMS of ZP centroid can go from 0 to 8.4 cm
double towerCutLow_ZPA[4] = {0, 0, 0, 0}; // Applied to all ZP fits except ZPI
double towerCutLow_ZPC[4] = {0, 0, 0, 0}; // Applied to all ZP fits except ZPI
double towerCutHigh_ZPA[4] = {std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity()}; // Applied to all ZP fits except ZPI
double towerCutHigh_ZPC[4] = {std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity()}; // Applied to all ZP fits except ZPI
bool cross_check = false;

int nb1[NH] = {0}; /// 1D histogram: number of bins
Expand Down
10 changes: 5 additions & 5 deletions Detectors/ZDC/calib/src/InterCalib.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -450,19 +450,19 @@ void InterCalib::cumulate(int ih, double tc, double t1, double t2, double t3, do
if (tc < mInterCalibConfig->cutLow[ih] || tc > mInterCalibConfig->cutHigh[ih]) {
return;
}
if ((ih == HidZPA || ih == HidZPAX)){
if(t1 < mInterCalibConfig->towerCutLow_ZPA[0] || t2 < mInterCalibConfig->towerCutLow_ZPA[1] || t3 < mInterCalibConfig->towerCutLow_ZPA[2] || t4 < mInterCalibConfig->towerCutLow_ZPA[3]){
if ((ih == HidZPA || ih == HidZPAX)) {
if (t1 < mInterCalibConfig->towerCutLow_ZPA[0] || t2 < mInterCalibConfig->towerCutLow_ZPA[1] || t3 < mInterCalibConfig->towerCutLow_ZPA[2] || t4 < mInterCalibConfig->towerCutLow_ZPA[3]) {
return;
}
if(t1 > mInterCalibConfig->towerCutHigh_ZPA[0] || t2 > mInterCalibConfig->towerCutHigh_ZPA[1] || t3 > mInterCalibConfig->towerCutHigh_ZPA[2] || t4 > mInterCalibConfig->towerCutHigh_ZPA[3]){
if (t1 > mInterCalibConfig->towerCutHigh_ZPA[0] || t2 > mInterCalibConfig->towerCutHigh_ZPA[1] || t3 > mInterCalibConfig->towerCutHigh_ZPA[2] || t4 > mInterCalibConfig->towerCutHigh_ZPA[3]) {
return;
}
}
if (ih == HidZPC || ih == HidZPCX) {
if(t1 < mInterCalibConfig->towerCutLow_ZPC[0] || t2 < mInterCalibConfig->towerCutLow_ZPC[1] || t3 < mInterCalibConfig->towerCutLow_ZPC[2] || t4 < mInterCalibConfig->towerCutLow_ZPC[3]){
if (t1 < mInterCalibConfig->towerCutLow_ZPC[0] || t2 < mInterCalibConfig->towerCutLow_ZPC[1] || t3 < mInterCalibConfig->towerCutLow_ZPC[2] || t4 < mInterCalibConfig->towerCutLow_ZPC[3]) {
return;
}
if(t1 > mInterCalibConfig->towerCutHigh_ZPC[0] || t2 > mInterCalibConfig->towerCutHigh_ZPC[1] || t3 > mInterCalibConfig->towerCutHigh_ZPC[2] || t4 > mInterCalibConfig->towerCutHigh_ZPC[3]){
if (t1 > mInterCalibConfig->towerCutHigh_ZPC[0] || t2 > mInterCalibConfig->towerCutHigh_ZPC[1] || t3 > mInterCalibConfig->towerCutHigh_ZPC[2] || t4 > mInterCalibConfig->towerCutHigh_ZPC[3]) {
return;
}
}
Expand Down
12 changes: 6 additions & 6 deletions Detectors/ZDC/calib/src/InterCalibEPN.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ int InterCalibEPN::process(const gsl::span<const o2::zdc::BCRecData>& RecBC,
float x, rms;
ev.centroidZPA(x, rms);
cumulate(HidZPA, ev.EZDC(IdZPAC), ev.EZDC(IdZPA1), ev.EZDC(IdZPA2), ev.EZDC(IdZPA3), ev.EZDC(IdZPA4), 1.);
if (x < -(mInterCalibConfig->xcut_ZPA) && rms >= mInterCalibConfig->rms_cut_ZP ) {
if (x < -(mInterCalibConfig->xcut_ZPA) && rms >= mInterCalibConfig->rms_cut_ZP) {
cumulate(HidZPAX, ev.EZDC(IdZPAC), ev.EZDC(IdZPA1), ev.EZDC(IdZPA2), ev.EZDC(IdZPA3), ev.EZDC(IdZPA4), 1.);
}
}
Expand Down Expand Up @@ -271,19 +271,19 @@ void InterCalibEPN::cumulate(int ih, double tc, double t1, double t2, double t3,
if (tc < mInterCalibConfig->cutLow[ih] || tc > mInterCalibConfig->cutHigh[ih]) {
return;
}
if ((ih == HidZPA || ih == HidZPAX)){
if(t1 < mInterCalibConfig->towerCutLow_ZPA[0] || t2 < mInterCalibConfig->towerCutLow_ZPA[1] || t3 < mInterCalibConfig->towerCutLow_ZPA[2] || t4 < mInterCalibConfig->towerCutLow_ZPA[4]){
if ((ih == HidZPA || ih == HidZPAX)) {
if (t1 < mInterCalibConfig->towerCutLow_ZPA[0] || t2 < mInterCalibConfig->towerCutLow_ZPA[1] || t3 < mInterCalibConfig->towerCutLow_ZPA[2] || t4 < mInterCalibConfig->towerCutLow_ZPA[4]) {
return;
}
if(t1 > mInterCalibConfig->towerCutHigh_ZPA[0] || t2 > mInterCalibConfig->towerCutHigh_ZPA[1] || t3 > mInterCalibConfig->towerCutHigh_ZPA[2] || t4 > mInterCalibConfig->towerCutHigh_ZPA[4]){
if (t1 > mInterCalibConfig->towerCutHigh_ZPA[0] || t2 > mInterCalibConfig->towerCutHigh_ZPA[1] || t3 > mInterCalibConfig->towerCutHigh_ZPA[2] || t4 > mInterCalibConfig->towerCutHigh_ZPA[4]) {
return;
}
}
if (ih == HidZPC || ih == HidZPCX) {
if(t1 < mInterCalibConfig->towerCutLow_ZPC[0] || t2 < mInterCalibConfig->towerCutLow_ZPC[1] || t3 < mInterCalibConfig->towerCutLow_ZPC[2] || t4 < mInterCalibConfig->towerCutLow_ZPC[4]){
if (t1 < mInterCalibConfig->towerCutLow_ZPC[0] || t2 < mInterCalibConfig->towerCutLow_ZPC[1] || t3 < mInterCalibConfig->towerCutLow_ZPC[2] || t4 < mInterCalibConfig->towerCutLow_ZPC[4]) {
return;
}
if(t1 > mInterCalibConfig->towerCutHigh_ZPC[0] || t2 > mInterCalibConfig->towerCutHigh_ZPC[1] || t3 > mInterCalibConfig->towerCutHigh_ZPC[2] || t4 > mInterCalibConfig->towerCutHigh_ZPC[4]){
if (t1 > mInterCalibConfig->towerCutHigh_ZPC[0] || t2 > mInterCalibConfig->towerCutHigh_ZPC[1] || t3 > mInterCalibConfig->towerCutHigh_ZPC[2] || t4 > mInterCalibConfig->towerCutHigh_ZPC[4]) {
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Detectors/ZDC/calib/src/WaveformCalibData.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ int WaveformCalibData::dumpCalib(const std::string fn)
LOG(error) << "Cannot create file: " << fn;
return 1;
}
f->WriteObjectAny((void*)this,o2::zdc::WaveformCalibData::Class(),"WaveformCalibData");
f->WriteObjectAny((void*)this, o2::zdc::WaveformCalibData::Class(), "WaveformCalibData");
f->Close();
cwd->cd();
return 0;
Expand Down
2 changes: 1 addition & 1 deletion Detectors/ZDC/calib/src/WaveformCalibEPN.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ int WaveformCalibEPN::endOfRun()
mData.getEntries(is), mConfig->cutLow[is], mConfig->cutHigh[is],
itdc, mConfig->cutTimeLow[itdc], mConfig->cutTimeHigh[itdc],
mData.getFirstValid(is), mData.mPeak, mData.getLastValid(is));
}else{
} else {
LOGF(info, "Waveform %2d %s with %10d events and cuts AMP:(%g:%g) TDC:%d:(%g:%g)", is, ChannelNames[is].data(),
mData.getEntries(is), mConfig->cutLow[is], mConfig->cutHigh[is],
itdc, mConfig->cutTimeLow[itdc], mConfig->cutTimeHigh[itdc]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,21 @@ class DigiParser
mVerbosity = v;
}
int getVerbosity() const { return mVerbosity; }
void setOutput(std::string output){
void setOutput(std::string output)
{
mOutput = output;
}
void setRejectPileUp(bool op = true){
void setRejectPileUp(bool op = true)
{
mRejectPileUp = op;
}
void eor();

void setModuleConfig(const ModuleConfig* moduleConfig) { mModuleConfig = moduleConfig; };
const ModuleConfig* getModuleConfig() { return mModuleConfig; };

private:
const ModuleConfig* mModuleConfig = nullptr; /// Trigger/readout configuration object
private:
const ModuleConfig* mModuleConfig = nullptr; /// Trigger/readout configuration object
const RecoParamZDC* mRopt = nullptr;

void setStat(TH1* h);
Expand All @@ -76,8 +78,8 @@ class DigiParser
int32_t mVerbosity = DbgMinimal;
bool mRejectPileUp = true;
std::string mOutput = "ZDCDigiParser.root";
uint32_t mTriggerMask = 0; /// Mask of triggering channels
uint32_t mChMask[NChannels] = {0}; /// Identify all channels in readout pattern
uint32_t mTriggerMask = 0; /// Mask of triggering channels
uint32_t mChMask[NChannels] = {0}; /// Identify all channels in readout pattern

std::unique_ptr<TH1> mTransmitted = nullptr;
std::unique_ptr<TH1> mFired = nullptr;
Expand Down
24 changes: 12 additions & 12 deletions Detectors/ZDC/reconstruction/src/DigiParser.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ void DigiParser::init()
if (mSignalTH[ich] == nullptr) {
TString hname = TString::Format("hsth_%s", ChannelNames[ich].data());
TString htit = TString::Format("Signal %s AUTOT & Hit; Sample; ADC", ChannelNames[ich].data());
if(mRejectPileUp){
if (mRejectPileUp) {
mSignalTH[ich] = std::make_unique<TH2F>(hname, htit, 3 * NTimeBinsPerBC, -0.5 - 1 * NTimeBinsPerBC, 2 * NTimeBinsPerBC - 0.5, ADCRange, ADCMin - 0.5, ADCMax + 0.5);
}else{
} else {
mSignalTH[ich] = std::make_unique<TH2F>(hname, htit, 5 * NTimeBinsPerBC, -0.5 - 3 * NTimeBinsPerBC, 2 * NTimeBinsPerBC - 0.5, ADCRange, ADCMin - 0.5, ADCMax + 0.5);
}
}
Expand Down Expand Up @@ -174,7 +174,7 @@ int DigiParser::process(const gsl::span<const o2::zdc::OrbitData>& orbitdata, co
if (chd.id > IdDummy && chd.id < NChannels) {
chRef[ibc][chd.id] = chEnt;
mTransmitted->Fill(chd.id);
if((bcdata[ibc].triggers & mChMask[chd.id]) != 0){
if ((bcdata[ibc].triggers & mChMask[chd.id]) != 0) {
mFired->Fill(chd.id);
}
}
Expand All @@ -192,19 +192,19 @@ int DigiParser::process(const gsl::span<const o2::zdc::OrbitData>& orbitdata, co
for (int ibn = -4; ibn < 5; ibn++) {
int ibt = ibc + ibn;
if (ibt >= 0) { // Check backward and current bunch
if(ibt < mNBC){
auto bcd = bcdata[ibt].ir.differenceInBC(ir);
if (bcd == ibn) {
if ((bcdata[ibt].triggers & mChMask[isig]) != 0) {
nsig++;
if (ibt < mNBC) {
auto bcd = bcdata[ibt].ir.differenceInBC(ir);
if (bcd == ibn) {
if ((bcdata[ibt].triggers & mChMask[isig]) != 0) {
nsig++;
}
}
} else {
break;
}
}else{
break;
}
}
}
if (nsig>1) {
if (nsig > 1) {
continue;
}
}
Expand Down
6 changes: 3 additions & 3 deletions Detectors/ZDC/workflow/include/ZDCWorkflow/DigitParserSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class DigitParserSpec : public o2::framework::Task
void endOfStream(o2::framework::EndOfStreamContext& ec) final;

private:
DigiParser mWorker; // Reconstruction object
int mVerbosity = 0; // Verbosity level during recostruction
bool mInitialized = false; // Connect once to CCDB during initialization
DigiParser mWorker; // Reconstruction object
int mVerbosity = 0; // Verbosity level during recostruction
bool mInitialized = false; // Connect once to CCDB during initialization
TStopwatch mTimer;
};

Expand Down
2 changes: 1 addition & 1 deletion Detectors/ZDC/workflow/src/RecoReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void RecoReader::run(ProcessingContext& pc)
auto ent = mTree->GetReadEntry() + 1;
assert(ent < mTree->GetEntries()); // this should not happen
mTree->GetEntry(ent);
LOG(info) << "ZDCRecoReader pushed " << RecBC.size() << " b.c. " << Energy.size() << " Energies " << TDCData.size() << " TDCs " << Info.size() << " Infos " << WaveformData.size() << " Waveform chunks";
LOG(info) << "ZDCRecoReader pushed " << RecBC.size() << " b.c. " << Energy.size() << " Energies " << TDCData.size() << " TDCs " << Info.size() << " Infos " << WaveformData.size() << " Waveform chunks";
pc.outputs().snapshot(Output{"ZDC", "BCREC", 0}, RecBC);
pc.outputs().snapshot(Output{"ZDC", "ENERGY", 0}, Energy);
pc.outputs().snapshot(Output{"ZDC", "TDCDATA", 0}, TDCData);
Expand Down

0 comments on commit 3b36d1f

Please sign in to comment.