26 #include "StChain/StChainOpt.h"
28 #include "StEvent/StEvent.h"
30 #include "StEvent/StETofCollection.h"
31 #include "StEvent/StETofDigi.h"
32 #include "StEvent/StETofHit.h"
34 #include "StEvent/StBTofCollection.h"
35 #include "StEvent/StBTofHit.h"
36 #include "StEvent/StBTofHeader.h"
38 #include "StETofQAMaker.h"
41 const Int_t uNbSectors = 12;
42 const Int_t uNbZPlanes = 3;
43 const Int_t uNbDetPerModule = 3;
44 const Int_t uNbStripsPerDet = 32;
46 const Double_t dStripPitch = 1.0;
48 const Double_t dBTofTimeRange = 51200;
50 const Double_t dCoarseClockCycleNs = 6.25;
53 const Double_t dETofTrigOffset = -9047;
63 mOutHistFileName(
"" ),
66 LOG_DEBUG <<
"StETofQAMaker::ctor" << endm;
70 StETofQAMaker::~StETofQAMaker()
86 mEvent =
dynamic_cast< StEvent*
> ( GetInputDS(
"StEvent" ) );
89 etofCollection = mEvent->etofCollection();
93 if ( !etofCollection ) {
95 LOG_INFO <<
"StETofQAMaker::GetETofCollection - making new StETofCollection and giving it to StEvent" << endm;
97 mEvent->setETofCollection( etofCollection );
100 LOG_INFO <<
"StETofQAMaker::GetETofCollection - StEvent already has a StETofCollection - not making a new one" << endm;
104 LOG_WARN <<
"No StEvent found by StETofQAMaker::GetETofCollection" << endm;
107 return etofCollection;
121 mEvent =
dynamic_cast< StEvent*
> ( GetInputDS(
"StEvent" ) );
124 btofCollection = mEvent->btofCollection();
128 if ( !btofCollection ) {
130 LOG_INFO <<
"StETofQAMaker::GetBTofCollection - no BTofCollection found!" << endm;
132 mEvent->setBTofCollection( btofCollection );
135 LOG_INFO <<
"StETofQAMaker::GetBTofCollection - StEvent already has a StBTofCollection - not making a new one" << endm;
139 LOG_WARN <<
"No StEvent found by StETofQAMaker::GetBTofCollection" << endm;
142 return btofCollection;
147 StETofQAMaker::Init()
151 mStorStDigi.resize( uNbSectors );
153 mStorStHit.resize( uNbSectors );
155 for( Int_t iSector = 0; iSector < uNbSectors; iSector++ ) {
156 mStorStDigi[ iSector ].resize( uNbZPlanes );
157 mStorStHit[ iSector ].resize( uNbZPlanes );
159 for( Int_t iPlane = 0; iPlane < uNbZPlanes; iPlane++ ) {
160 mStorStDigi[ iSector ][ iPlane ].resize( uNbDetPerModule );
161 mStorStHit[ iSector ][ iPlane ].resize( uNbDetPerModule );
164 for( Int_t iDet = 0; iDet < uNbDetPerModule; iDet++ ) {
165 mStorStDigi[ iSector ][ iPlane ][ iDet ].resize( uNbStripsPerDet );
166 LOG_DEBUG <<
"StETofQAMaker::Init::Detectors" << endm;
172 LOG_INFO <<
"StETofQAMaker::Init" << endm;
182 StETofQAMaker::InitRun( Int_t runnumber )
189 StETofQAMaker::FinishRun( Int_t runnumber )
207 LOG_INFO <<
"StETofQAMaker::Make(): starting..." << endm;
211 LOG_INFO <<
"StETofQAMaker::Make() - getting the eTOF collection " << mETofCollection << endm;
212 LOG_INFO <<
"StETofQAMaker::Make() - nDigis = " << ( mETofCollection->etofDigis() ).size() << endm;
213 LOG_INFO <<
"StETofQAMaker::Make() - nHits = " << ( mETofCollection->etofHits() ).size() << endm;
218 LOG_INFO <<
"StETofQAMaker::Make() - getting the bTOF collection " << mBTofCollection << endm;
219 LOG_INFO <<
"StETofQAMaker::Make() - nHits = " << ( mBTofCollection->tofHits() ).size() << endm;
231 StETofQAMaker::calcTStart()
233 LOG_INFO <<
"StETofQAMaker::calcTStart(): -- loading Vpd data from bTof header" << endm;
235 if( !mBTofCollection )
return;
237 StBTofHeader* bTofHeader = mBTofCollection->tofHeader();
240 LOG_INFO <<
"StETofQAMaker::calcTStart(): -- no bTof header. Skip start time calculation." << endm;
247 double tSumWest = 0.;
248 double tSumEast = 0.;
250 int nWest = bTofHeader->numberOfVpdHits( west );
251 int nEast = bTofHeader->numberOfVpdHits( east );
253 double vpdLeTime[ 2 * nVpd ];
256 if( fabs( bTofHeader->vpdVz() - ( -9999. ) ) < 0.1 ) {
257 LOG_INFO <<
" no valid Vpd data in the bTOF header " << endm;
261 LOG_INFO <<
"Vpd Vertex is at: " << bTofHeader->vpdVz() << endm;
265 for(
int i=0; i< nVpd; i++ ) {
266 vpdLeTime[ i ] = bTofHeader->vpdTime( west, i+1 );
267 if( vpdLeTime[ i ] > 0. ) {
268 tSumWest += vpdLeTime[ i ];
269 LOG_INFO <<
" loading VPD west tubeId = " << i+1 <<
" time " << vpdLeTime[ i ] << endm;
274 for(
int i=0; i< nVpd; i++ ) {
275 vpdLeTime[ i + nVpd ] = bTofHeader->vpdTime( east, i+1 );
276 if( vpdLeTime[ i + nVpd ] > 0. ) {
277 tSumEast += vpdLeTime[ i + nVpd ];
278 LOG_INFO <<
" loading VPD east tubeId = " << i+1 <<
" time " << vpdLeTime[ i + nVpd ] << endm;
283 LOG_INFO <<
"StETofQAMaker::calcTStart(): -- calculating Vpd start time" << endm;
285 double tSum = tSumWest + tSumEast;
287 if( nWest + nEast ) {
288 mTStart = tSum / ( nWest + nEast );
290 LOG_INFO <<
"StETofQAMaker::calcTStart(): -- Vpd start time: " << mTStart << endm;
297 StETofQAMaker::createHistos()
299 mHistRpcCluSize.clear();
300 mHistRpcCluSize.resize( uNbSectors );
302 mHistRpcCluPosition.clear();
303 mHistRpcCluPosition.resize( uNbSectors );
305 mHistRpcCluTOff.clear();
306 mHistRpcCluTOff.resize( uNbSectors );
308 mHistRpcCluTot.clear();
309 mHistRpcCluTot.resize( uNbSectors );
311 mHistRpcDigiTot.clear();
312 mHistRpcDigiTot.resize( uNbSectors );
314 mHistRpcCluAvWalk.clear();
315 mHistRpcCluAvWalk.resize( uNbSectors );
317 mHistRpcCluMul.clear();
318 mHistRpcCluMul.resize( uNbSectors );
320 mHistHitTrigTimeDet.clear();
321 mHistHitTrigTimeDet.resize( uNbSectors );
323 mHistBTofAvTimeDiff =
new TH1F(
324 Form(
"Av_TDiff_ETof_BTof" ),
325 Form(
"Difference between average hits times in Events between BTof and ETof; dT [ns]; Events []" ),
326 102400, -51200, 51200 );
328 mHistHitTrigTimeDiff=
new TH1F(
329 Form(
"Hit_TDiff_ETof_Trg" ),
330 Form(
"Difference between hits on ETof and the trigger token; dT [ns]; Events []" ),
331 10240, -51200, 51200 );
333 mHistDigiTrigTimeDiff=
new TH1F(
334 Form(
"Digi_TDiff_ETof_Trg" ),
335 Form(
"Difference between Digis on ETof and the trigger token; dT [ns]; Events []" ),
336 10240, -51200, 51200 );
338 mHistDigiRawTrigTimeDiff=
new TH1F(
339 Form(
"DigiRaw_TDiff_ETof_Trg" ),
340 Form(
"Raw time difference between Digis on ETof and the trigger token; dT [ns]; Events []" ),
341 10240, -51200, 51200 );
343 mHistBTofETofMul =
new TH2F(
344 Form(
"Mul_ETof_BTof" ),
345 Form(
"Multiplicity correlation between ETof and BTof; ETof Multiplicity []; BTof Multiplicity []" ),
349 mHistBTofAvTimeDiffvETofMul=
new TH2F(
350 Form(
"Av_TDiff_v_Mul_ETof" ),
351 Form(
"Difference between average hits times in Events between BTof and ETof vs ETof multiplicity; dT [ns]; ETof Multiplicity []" ),
352 10240, -51200, 51200,
355 mHistBTofAvTimeDiffvBTofMul=
new TH2F(
356 Form(
"Av_TDiff_v_Mul_BTof" ),
357 Form(
"Difference between average hits times in Events between BTof and ETof vs ETof multiplicity; dT [ns]; BTof Multiplicity []" ),
358 10240, -51200, 51200,
362 mHistETofTimeOfFlight =
new TH1F(
"ETof_Time_of_Flight",
"time of flight for eTof hits; Tof [ns]; # ETof hits", 1000, 300, 600 );
363 mHistBTofTimeOfFlight =
new TH1F(
"BTof_Time_of_Flight",
"time of flight for bTof hits; Tof [ns]; # BTof hits", 1000, -150, 150 );
367 for( Int_t iSector = 0; iSector < uNbSectors; iSector++ ) {
368 mHistRpcCluSize[ iSector ].resize( uNbZPlanes );
369 mHistRpcCluPosition[ iSector ].resize( uNbZPlanes );
370 mHistRpcCluTOff[ iSector ].resize( uNbZPlanes );
371 mHistRpcCluTot[ iSector ].resize( uNbZPlanes );
372 mHistRpcDigiTot[ iSector ].resize( uNbZPlanes );
373 mHistRpcCluAvWalk[ iSector ].resize( uNbZPlanes );
374 mHistRpcCluMul[ iSector ].resize( uNbZPlanes );
375 mHistHitTrigTimeDet[ iSector ].resize( uNbSectors );
377 for( Int_t iPlane = 0; iPlane < uNbZPlanes; iPlane++ ) {
378 mHistRpcCluSize[ iSector ][ iPlane ].resize( uNbDetPerModule );
379 mHistRpcCluPosition[ iSector ][ iPlane ].resize( uNbDetPerModule );
380 mHistRpcCluTOff[ iSector ][ iPlane ].resize( uNbDetPerModule );
381 mHistRpcCluTot[ iSector ][ iPlane ].resize( uNbDetPerModule );
382 mHistRpcDigiTot[ iSector ][ iPlane ].resize( uNbDetPerModule );
383 mHistRpcCluAvWalk[ iSector ][ iPlane ].resize( uNbDetPerModule );
384 mHistRpcCluMul[ iSector ][ iPlane ].resize( uNbDetPerModule );
385 mHistHitTrigTimeDet[ iSector ][ iPlane ].resize( uNbSectors );
387 for( Int_t iDet = 0; iDet < uNbDetPerModule; iDet++ ) {
390 mHistRpcCluSize[ iSector ][ iPlane ][ iDet ] =
new TH2F(
391 Form(
"cl_Sector%02d_ZPlane%d_Det%d_Size", iSector+13, iPlane, iDet ),
392 Form(
"Cluster size of Det #%02d in ZPlane %d under Sector %02d; Strip []; size [strips]", iDet, iPlane, iSector+13 ),
393 32, 0, 32, 16, 0.5, 16.5 );
395 mHistRpcCluPosition[ iSector ][ iPlane ][ iDet ] =
new TH2F(
396 Form(
"cl_Sector%02d_ZPlane%d_Det%d_Pos", iSector+13, iPlane, iDet ),
397 Form(
"Cluster position of of Det #%02d in ZPlane %d under Sector %02d; Strip []; ypos [cm]", iDet, iPlane, iSector+13 ),
398 32, 0, 32, 100, -50, 50 );
400 mHistRpcCluTOff[ iSector ][ iPlane ][ iDet ] =
new TH2F(
401 Form(
"cl_Sector%02d_ZPlane%d_Det%d_TOff", iSector+13, iPlane, iDet ),
402 Form(
"Cluster timezero of Det #%02d in ZPlane %d under Sector %02d; Strip []; TOff [ns]", iDet, iPlane, iSector+13 ),
403 32, 0, 32, 100, -tSumMax, tSumMax );
405 mHistRpcCluTot[ iSector ][ iPlane ][ iDet ] =
new TH2F(
406 Form(
"cl_Sector%02d_ZPlane%d_Det%d_Tot", iSector+13, iPlane, iDet ),
407 Form(
"Total Cluster Tot of Det #%02d in ZPlane %d under Sector %02d; Strip []; TOT [ns]", iDet, iPlane, iSector+13 ),
408 32, 0, 32, 100, 0, 100 );
410 mHistRpcDigiTot[ iSector ][ iPlane ][ iDet ] =
new TH2F(
411 Form(
"cl_Sector%02d_ZPlane%d_Det%d_TotDigi", iSector+13, iPlane, iDet ),
412 Form(
"Total Digi Tot of Det #%02d in ZPlane %d under Sector %02d; Chan []; TOT [ns]", iDet, iPlane, iSector+13 ),
413 64, 0, 64, 50, 0, 20 );
415 mHistRpcCluAvWalk[ iSector ][ iPlane ][ iDet ] =
new TH2F(
416 Form(
"cl_Sector%02d_ZPlane%d_Det%d_AvWalk", iSector+13, iPlane, iDet ),
417 Form(
"Walk in Det #%02d in ZPlane %d under Sector %02d; cluster TOT; T-TSel", iDet, iPlane, iSector+13 ),
418 25, 0, 10, 400, -tSumMax, tSumMax );
420 mHistRpcCluMul[ iSector ][ iPlane ][ iDet ] =
new TH1F(
421 Form(
"cl_Sector%02d_ZPlane%d_Det%d_Mul", iSector+13, iPlane, iDet ),
422 Form(
"Cluster multiplicity of Det #%02d in ZPlane %d under Sector %02d; Mul []; cnts", iDet, iPlane, iSector+13 ),
425 mHistHitTrigTimeDet[ iSector ][ iPlane ][ iDet ] =
new TH1F(
426 Form(
"Hit_TDiff_Trg_Sector%02d_ZPlane%d_Det%d_Mul", iSector+13, iPlane, iDet ),
427 Form(
"Difference between hits on Det #%02d in ZPlane %d under Sector %02d and the trigger token; dT [ns]; Events []", iDet, iPlane, iSector+13 ),
428 10240, -51200, 51200 );
430 LOG_DEBUG <<
"StETofQAMaker::Init() - createHistos: successfully created histograms for detector " << iSector+13 << iPlane << iDet << endm;
440 StETofQAMaker::fillHistos()
442 LOG_INFO <<
"StETofQAMaker::fillHistos(): -- filling histograms for calibration and QA" << endm;
447 StETofHeader* etofHeader = mETofCollection->etofHeader();
450 LOG_WARN <<
"StETofQAMaker::fillHistos(): -- no eTof Header available -> skip event." << endm;
455 if( etofHeader->rocStarTs().count( 0x18e6 ) == 0 ) {
456 LOG_WARN <<
"StETofQAMaker::fillHistos(): -- no reset time for AFCK 0x18e6 available -> skip event." << endm;
460 double triggerTime = etofHeader->trgGdpbFullTime() - ( etofHeader->rocStarTs().at( 0x18e6 ) * dCoarseClockCycleNs );
462 uint64_t iBTofOverflows = ( uint64_t ) ( triggerTime / dBTofTimeRange );
464 triggerTime-= iBTofOverflows*dBTofTimeRange;
465 LOG_INFO <<
"corrected trigger time: "<< triggerTime <<
" ns" << endm;
467 double avEtofTime = 0;
468 double avBtofTime = 0;
469 StSPtrVecBTofHit bTofHits = 0;
470 Int_t nHitsInTrigWindow = 0;
474 for( Int_t iSector = 0; iSector < uNbSectors; iSector++ ) {
476 for( Int_t iPlane = 0; iPlane < uNbZPlanes; iPlane++ ) {
478 for( Int_t iDet = 0; iDet < uNbDetPerModule; iDet++ ) {
479 mStorStHit[ iSector ][ iPlane ][ iDet ].clear();
480 mStorStHit[ iSector ][ iPlane ][ iDet ].resize( 0 );
482 for( Int_t iStrip = 0; iStrip < uNbStripsPerDet; iStrip++ ) {
483 mStorStDigi[ iSector ][ iPlane ][ iDet ][ iStrip ].clear();
484 mStorStDigi[ iSector ][ iPlane ][ iDet ][ iStrip ].resize( 0 );
492 StSPtrVecETofDigi digis = mETofCollection->etofDigis();
493 Int_t nbDigis = digis.size();
494 Int_t nbDigisInStor = 0;
497 for( Int_t iDigiPos = 0; iDigiPos < nbDigis; iDigiPos++ ) {
499 pDigi = digis[ iDigiPos ];
502 LOG_DEBUG <<
"StETofQAMaker::fillHistos(): -- digi not calibrated, most likely since it is outside the trigger window. Ignore." << endm;
507 LOG_WARN <<
"StETofQAMaker::fillHistos(): -- sector / zPlane / counter / strip was not assigned to the digi" << endm;
511 mStorStDigi[ pDigi->
sector() - 13 ]
514 [ pDigi->
strip() - 1 ].push_back( pDigi );
519 LOG_INFO <<
"storage vector is filled with " << nbDigisInStor <<
" digis" << endm;
522 StSPtrVecETofHit hits = mETofCollection->etofHits();
523 Int_t nbHits = hits.size();
524 Int_t nbHitsInStor = 0;
527 for( Int_t iHitPos = 0; iHitPos < nbHits; iHitPos++ ) {
528 pHit = hits[ iHitPos ];
531 LOG_ERROR <<
"StETofQAMaker::fillHistos(): -- sector / zPlane / counter was not assigned to the hit -- something is wrong!" << endm;
535 mStorStHit[ pHit->
sector() - 13 ]
537 [ pHit->
counter() - 1 ].push_back( pHit );
542 LOG_INFO <<
"storage vector is filled with "<< nbHitsInStor <<
" hits" << endm;
544 for( Int_t iSector = 0; iSector < uNbSectors; iSector++ ) {
545 for( Int_t iPlane = 0; iPlane < uNbZPlanes; iPlane++ ) {
546 for( Int_t iDet = 0; iDet < uNbDetPerModule; iDet++ ) {
548 if( mStorStHit[ iSector ][ iPlane ][ iDet ].size() > 0 ) {
549 LOG_DEBUG << iSector + 13 <<
" " << iPlane + 1 <<
" " << iDet + 1 <<
" size mStorStHit: " << mStorStHit[ iSector ][ iPlane ][ iDet ].size() << endm;
550 mHistRpcCluMul[ iSector ][ iPlane ][ iDet ]->Fill( mStorStHit[ iSector ][ iPlane ][ iDet ].size() );
552 for(
unsigned int i = 0; i < mStorStHit[ iSector ][ iPlane ][ iDet ].size(); i++ ) {
557 if( mTimeOffset == 0 ) {
558 mTimeOffset = mStorStHit[iSector][iPlane][iDet].at(i)->time();
560 LOG_DEBUG <<
"The time offset is set to " << mTimeOffset << endm;
562 mHistRpcCluSize[ iSector ][ iPlane ][ iDet ]->Fill( mStorStHit[ iSector ][ iPlane ][ iDet ].at( i )->localX() + ( uNbStripsPerDet / 2.0 ),
563 mStorStHit[ iSector ][ iPlane ][ iDet ].at( i )->clusterSize() );
564 mHistRpcCluPosition[ iSector ][ iPlane ][ iDet ]->Fill( mStorStHit[ iSector ][ iPlane ][ iDet ].at( i )->localX() + ( uNbStripsPerDet / 2.0 ),
565 mStorStHit[ iSector ][ iPlane ][ iDet ].at( i )->localY() );
566 mHistRpcCluTOff[ iSector ][ iPlane ][ iDet ]->Fill( mStorStHit[ iSector ][ iPlane ][ iDet ].at( i )->localX() + ( uNbStripsPerDet / 2.0 ),
567 mStorStHit[ iSector ][ iPlane ][ iDet ].at( i )->time() - mTimeOffset );
568 mHistRpcCluTot[ iSector ][ iPlane ][ iDet ]->Fill( mStorStHit[ iSector ][ iPlane ][ iDet ].at( i )->localX() + ( uNbStripsPerDet / 2.0 ),
569 mStorStHit[ iSector ][ iPlane ][ iDet ].at( i )->totalTot() );
570 mHistRpcCluAvWalk[ iSector ][ iPlane ][ iDet ]->Fill( mStorStHit[ iSector ][ iPlane ][ iDet ].at( i )->totalTot(),
571 mStorStHit[ iSector ][ iPlane ][ iDet ].at( i )->time() - mTimeOffset );
573 mHistHitTrigTimeDiff->Fill( mStorStHit[ iSector ][ iPlane ][ iDet ].at( i )->time()-triggerTime );
575 mHistHitTrigTimeDet[ iSector ][ iPlane ][ iDet ]->Fill( mStorStHit[ iSector ][ iPlane ][ iDet ].at( i )->time()-triggerTime );
578 avEtofTime += mStorStHit[ iSector ][ iPlane ][ iDet ].at( i )->time();
589 avEtofTime /= nHitsInTrigWindow;
591 if( avEtofTime > 51200 ) { LOG_DEBUG <<
"Average ETof time out of range: "<< avEtofTime << endm; }
594 for( Int_t iSector = 0; iSector < uNbSectors; iSector++ ) {
595 for( Int_t iPlane = 0; iPlane < uNbZPlanes; iPlane++ ) {
596 for( Int_t iDet = 0; iDet < uNbDetPerModule; iDet++ ) {
597 for( Int_t iStrip = 0; iStrip < uNbStripsPerDet; iStrip++ ) {
599 if( mStorStDigi[ iSector ][ iPlane ][ iDet ][ iStrip ].size() > 0 ) {
600 LOG_DEBUG << iSector+13 <<
" " << iPlane+1 <<
" " << iDet+1 <<
" " << iStrip+1 <<
" size mStorStDigi: " << mStorStDigi[ iSector ][ iPlane ][ iDet ][ iStrip ].size() << endm;
602 for(
unsigned int i=0; i<mStorStDigi[ iSector ][ iPlane ][ iDet ][ iStrip ].size(); i++ ) {
603 mHistRpcCluAvWalk[ iSector ][ iPlane ][ iDet ]->Fill( mStorStDigi[ iSector ][ iPlane ][ iDet ][ iStrip ].at( i )->calibTot(),
604 mStorStDigi[ iSector ][ iPlane ][ iDet ][ iStrip ].at( i )->calibTime() - mTimeOffset );
605 mHistRpcDigiTot[ iSector ][ iPlane ][ iDet ]->Fill( mStorStDigi[ iSector ][ iPlane ][ iDet ][ iStrip ].at( i )->strip() + 32 * ( mStorStDigi[ iSector ][ iPlane ][ iDet ][ iStrip ].at( i )->side() - 1 ) - 1,
606 mStorStDigi[ iSector ][ iPlane ][ iDet ][ iStrip ].at( i )->calibTot() );
608 mHistDigiRawTrigTimeDiff->Fill( mStorStDigi[ iSector ][ iPlane ][ iDet ][ iStrip ].at( i )->rawTime() - ( etofHeader->trgGdpbFullTime() ) );
610 mHistDigiTrigTimeDiff->Fill( mStorStDigi[ iSector ][ iPlane ][ iDet ][ iStrip ].at( i )->calibTime() - triggerTime );
621 if( mBTofCollection ) {
622 bTofHits = mBTofCollection->tofHits();
624 if( bTofHits.size() && nbHits ) {
625 for( UInt_t iHit = 0; iHit < bTofHits.size(); iHit++ ) {
626 avBtofTime += bTofHits[iHit]->leadingEdgeTime();
628 avBtofTime /= bTofHits.size();
630 mHistBTofAvTimeDiff ->Fill( avEtofTime - avBtofTime );
631 mHistBTofAvTimeDiffvETofMul->Fill( avEtofTime - avBtofTime, nHitsInTrigWindow );
632 mHistBTofAvTimeDiffvBTofMul->Fill( avEtofTime - avBtofTime, bTofHits.size() );
633 mHistBTofETofMul ->Fill( nHitsInTrigWindow, bTofHits.size() );
639 if( mETofCollection ) {
640 StSPtrVecETofHit eHits = mETofCollection->etofHits();
641 int nEHits = eHits.size();
642 for(
int i = 0; i < nEHits; i++ ) {
644 float timeOfFlight = eHits[ i ]->time() - mTStart;
645 mHistETofTimeOfFlight->Fill( timeOfFlight );
653 if( mBTofCollection ) {
654 StSPtrVecBTofHit bHits = mBTofCollection->tofHits();
655 int nBHits = bHits.size();
656 for(
int i = 0; i < nBHits; i++ ) {
658 float timeOfFlight = bHits[ i ]->leadingEdgeTime() - mTStart;
659 mHistBTofTimeOfFlight->Fill( timeOfFlight );
671 StETofQAMaker::writeHistos()
673 std::string extension =
".etofQA.root";
675 if( GetChainOpt()->GetFileOut() !=
nullptr ) {
676 TString outFile = GetChainOpt()->GetFileOut();
678 mOutHistFileName = ( std::string ) outFile;
681 size_t lastindex = mOutHistFileName.find_last_of(
"." );
682 mOutHistFileName = mOutHistFileName.substr( 0, lastindex );
685 lastindex = mOutHistFileName.find_last_of(
"." );
686 mOutHistFileName = mOutHistFileName.substr( 0, lastindex );
689 lastindex = mOutHistFileName.find_last_of(
"/" );
690 mOutHistFileName = mOutHistFileName.substr( lastindex + 1, mOutHistFileName.length() );
692 mOutHistFileName = mOutHistFileName + extension;
694 LOG_ERROR <<
"Cannot set the output filename for histograms" << endm;
697 LOG_INFO <<
"StETofQAMaker::writeHistos -- creating file to save histograms" << endm;
698 TFile histFile( mOutHistFileName.c_str(),
"RECREATE",
"etofQA" );
701 mHistBTofAvTimeDiff ->Write();
702 mHistHitTrigTimeDiff ->Write();
703 mHistDigiTrigTimeDiff ->Write();
704 mHistDigiRawTrigTimeDiff ->Write();
705 mHistBTofETofMul ->Write();
706 mHistBTofAvTimeDiffvETofMul->Write();
707 mHistBTofAvTimeDiffvBTofMul->Write();
709 mHistETofTimeOfFlight ->Write();
710 mHistBTofTimeOfFlight ->Write();
712 for( Int_t iSector = 0; iSector < uNbSectors; iSector++ ) {
713 for( Int_t iPlane = 0; iPlane < uNbZPlanes; iPlane++ ) {
714 for( Int_t iDet = 0; iDet < uNbDetPerModule; iDet++ ) {
715 mHistRpcCluSize[ iSector ][ iPlane ][ iDet ]->Write();
716 mHistRpcCluPosition[ iSector ][ iPlane ][ iDet ]->Write();
717 mHistRpcCluTOff[ iSector ][ iPlane ][ iDet ]->Write();
718 mHistRpcCluTot[ iSector ][ iPlane ][ iDet ]->Write();
719 mHistRpcDigiTot[ iSector ][ iPlane ][ iDet ]->Write();
720 mHistRpcCluAvWalk[ iSector ][ iPlane ][ iDet ]->Write();
721 mHistRpcCluMul[ iSector ][ iPlane ][ iDet ]->Write();
722 mHistHitTrigTimeDet[ iSector ][ iPlane ][ iDet ]->Write();
double calibTime() const
calibrated time
StETofQAMaker(const char *name="etofQa")
Default constructor.
unsigned int zPlane() const
ZPlane.
StBTofCollection * GetBTofCollection()
unsigned int sector() const
Sector.
unsigned int strip() const
Strip.
unsigned int counter() const
Counter.
unsigned int zPlane() const
ZPlane.
unsigned int sector() const
Sector.
unsigned int counter() const
Counter.
double calibTot() const
Getter for calibrated Tot.
StETofCollection * GetETofCollection()