1616#include < sstream>
1717#include < string>
1818#include < vector>
19+ #include < numeric>
1920
2021#include " Framework/runDataProcessing.h"
2122#include " Framework/AnalysisTask.h"
@@ -75,6 +76,7 @@ struct ClusterMonitor {
7576
7677 std::vector<int > mVetoBCIDs ;
7778 std::vector<int > mSelectBCIDs ;
79+ std::vector<float > mCellTime ;
7880
7981 // / \brief Create output histograms and initialize geometry
8082 void init (InitContext const &)
@@ -94,6 +96,8 @@ struct ClusterMonitor {
9496 const o2Axis supermoduleAxis{20 , -0.5 , 19.5 , " Supermodule ID" };
9597 o2Axis timeAxis{mClusterTimeBinning , " t_{cl} (ns)" };
9698 o2Axis numberClustersAxis{mNumberClusterBinning , " Number of clusters / event" };
99+ const AxisSpec thAxisCellTimeDiff{3000 , -1500 , 1500 , " #Delta#it{t}_{cell} (ns)" };
100+ const AxisSpec thAxisCellTimeMean{1500 , -600 , 900 , " #LT#it{t}_{cell}#GT (ns)" };
97101
98102 // event properties
99103 mHistManager .add (" eventsAll" , " Number of events" , o2HistType::kTH1F , {{1 , 0.5 , 1.5 }});
@@ -121,6 +125,8 @@ struct ClusterMonitor {
121125 mHistManager .add (" clusterDistanceToBadChannel" , " Distance to bad channel" , o2HistType::kTH1F , {{100 , 0 , 100 }});
122126 mHistManager .add (" clusterTimeVsE" , " Cluster time vs energy" , o2HistType::kTH2F , {timeAxis, energyAxis});
123127 mHistManager .add (" clusterAmpFractionLeadingCell" , " Fraction of energy in leading cell" , o2HistType::kTH1F , {{100 , 0 , 1 }});
128+ mHistManager .add (" clusterCellTimeDiff" , " Cell time difference in clusters" , o2HistType::kTH1D , {thAxisCellTimeDiff});
129+ mHistManager .add (" clusterCellTimeMean" , " Mean cell time per cluster" , o2HistType::kTH1D , {thAxisCellTimeMean});
124130
125131 // add histograms per supermodule
126132 for (int ism = 0 ; ism < 20 ; ++ism) {
@@ -238,12 +244,21 @@ struct ClusterMonitor {
238244 auto cellsofcluster = emccluscells.sliceBy (perCluster, cluster.globalIndex ());
239245 double maxamp = 0 ;
240246 double ampfraction = 0 ;
247+ mCellTime .clear ();
248+ mCellTime .reserve (cellsofcluster.size ());
241249 for (const auto & cell : cellsofcluster) {
242250 // example how to get any information of the cell associated with cluster
243251 LOG (debug) << " Cell ID:" << cell.calo ().amplitude () << " Time " << cell.calo ().time ();
244252 if (cell.calo ().amplitude () > maxamp) {
245253 maxamp = cell.calo ().amplitude ();
246254 }
255+ mCellTime .push_back (cell.calo ().time ());
256+ } // end of loop over cells
257+ mHistManager .fill (HIST (" clusterCellTimeMean" ), std::accumulate (mCellTime .begin (), mCellTime .end (), 0 .0f ) / mCellTime .size ());
258+ for (int iCell1 = 0 ; iCell1 < mCellTime .size () - 1 ; iCell1++) {
259+ for (int iCell2 = iCell1 + 1 ; iCell2 < mCellTime .size (); iCell2++) {
260+ mHistManager .fill (HIST (" clusterCellTimeDiff" ), mCellTime [iCell1] - mCellTime [iCell2]);
261+ }
247262 }
248263 ampfraction = maxamp / cluster.energy ();
249264 mHistManager .fill (HIST (" clusterAmpFractionLeadingCell" ), ampfraction);
0 commit comments