CbmRoot
CbmMcbmCheckTimingTask.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
9 
11 
13 #include "FairLogger.h"
14 
16 #include "TH1.h"
17 #include "TH2.h"
18 #include "THttpServer.h"
19 #include <TFile.h>
20 
22 
23 // ---- Default constructor -------------------------------------------
25  : FairTask("CbmMcbmCheckTimingTask") {
28 }
29 
30 // ---- Destructor ----------------------------------------------------
32 
33 // ---- Initialisation ----------------------------------------------
36 }
37 
38 // ---- Init ----------------------------------------------------------
41  if (kTRUE == fpAlgo->Init())
42  return kSUCCESS;
43  else
44  return kFATAL;
45 }
46 
47 // ---- ReInit -------------------------------------------------------
48 InitStatus CbmMcbmCheckTimingTask::ReInit() { return kSUCCESS; }
49 
50 // ---- Exec ----------------------------------------------------------
51 void CbmMcbmCheckTimingTask::Exec(Option_t* /*option*/) {
52  LOG(debug2) << "CbmMcbmCheckTimingTask::Exec => Starting sequence";
54  fpAlgo->ProcessTs();
55 
56  LOG(debug2) << "CbmMcbmCheckTimingTask::Exec => Done";
57 }
58 
59 
60 // ---- Finish --------------------------------------------------------
62  SaveHistos();
63 
65  fpAlgo->Finish();
66 }
67 //----------------------------------------------------------------------
70  /*
72  std::vector< std::pair< TNamed *, std::string > > vHistos = fpAlgo->GetHistoVector();
73 
75  TDirectory * oldDir = NULL;
76  TFile * histoFile = NULL;
78  oldDir = gDirectory;
80  histoFile = new TFile( fsOutFileName , "RECREATE");
81  histoFile->cd();
82 
84  for( UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto )
85  {
87  TString sFolder = vHistos[ uHisto ].second.data();
88  if( nullptr == gDirectory->Get( sFolder ) )
89  gDirectory->mkdir( sFolder );
90  gDirectory->cd( sFolder );
91 
93  vHistos[ uHisto ].first->Write();
94 
95  histoFile->cd();
96  } // for( UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto )
97 
99  oldDir->cd();
100  histoFile->Close();
101 */
102 }
103 //----------------------------------------------------------------------
105  fsOutFileName = sNameIn;
107 }
108 //----------------------------------------------------------------------
110  std::string sNameIn,
111  Double_t dTimeRangeBegIn,
112  Double_t dTimeRangeEndIn,
113  UInt_t uRangeNbBinsIn,
114  UInt_t uChargeCutMinIn,
115  UInt_t uChargeCutMaxIn) {
116  fpAlgo->SetReferenceDetector(refDetIn,
117  sNameIn,
118  dTimeRangeBegIn,
119  dTimeRangeEndIn,
120  uRangeNbBinsIn,
121  uChargeCutMinIn,
122  uChargeCutMaxIn);
123 }
125  std::string sNameIn,
126  Double_t dTimeRangeBegIn,
127  Double_t dTimeRangeEndIn,
128  UInt_t uRangeNbBinsIn,
129  UInt_t uChargeCutMinIn,
130  UInt_t uChargeCutMaxIn) {
131  fpAlgo->AddCheckDetector(detIn,
132  sNameIn,
133  dTimeRangeBegIn,
134  dTimeRangeEndIn,
135  uRangeNbBinsIn,
136  uChargeCutMinIn,
137  uChargeCutMaxIn);
138 }
139 
141  fpAlgo->RemoveCheckDetector(detIn);
142 }
143 
144 //----------------------------------------------------------------------
CbmMcbmCheckTimingTask::fpAlgo
CbmMcbmCheckTimingAlgo * fpAlgo
Definition: CbmMcbmCheckTimingTask.h:76
CbmMcbmCheckTimingTask.h
CbmMcbmCheckTimingTask::Finish
virtual void Finish()
Definition: CbmMcbmCheckTimingTask.cxx:61
CbmMcbmCheckTimingTask::Exec
virtual void Exec(Option_t *)
Definition: CbmMcbmCheckTimingTask.cxx:51
CbmMcbmCheckTimingAlgo::WriteHistos
void WriteHistos()
Definition: CbmMcbmCheckTimingAlgo.cxx:417
CbmMcbmCheckTimingAlgo::RemoveCheckDetector
void RemoveCheckDetector(ECbmModuleId detIn)
Definition: CbmMcbmCheckTimingAlgo.cxx:493
CbmMcbmCheckTimingTask::SetOutFilename
void SetOutFilename(TString sNameIn)
Definition: CbmMcbmCheckTimingTask.cxx:104
CbmMcbmCheckTimingTask::SetReferenceDetector
void SetReferenceDetector(ECbmModuleId refDetIn, std::string sNameIn, Double_t dTimeRangeBegIn=-1000.0, Double_t dTimeRangeEndIn=1000.0, UInt_t uRangeNbBinsIn=320, UInt_t uChargeCutMinIn=0, UInt_t uChargeCutMaxIn=0)
Definition: CbmMcbmCheckTimingTask.cxx:109
CbmMcbmCheckTimingTask::RemoveCheckDetector
void RemoveCheckDetector(ECbmModuleId detIn)
Definition: CbmMcbmCheckTimingTask.cxx:140
ECbmModuleId
ECbmModuleId
Definition: CbmDefs.h:33
CbmMcbmCheckTimingTask::ReInit
virtual InitStatus ReInit()
Definition: CbmMcbmCheckTimingTask.cxx:48
CbmMcbmCheckTimingTask
Definition: CbmMcbmCheckTimingTask.h:23
CbmMcbmCheckTimingAlgo::SetReferenceDetector
void SetReferenceDetector(ECbmModuleId refDetIn, std::string sNameIn, Double_t dTimeRangeBegIn=-1000.0, Double_t dTimeRangeEndIn=1000.0, UInt_t uRangeNbBinsIn=320, UInt_t uChargeCutMinIn=0, UInt_t uChargeCutMaxIn=0)
Definition: CbmMcbmCheckTimingAlgo.cxx:442
CbmMcbmCheckTimingTask::~CbmMcbmCheckTimingTask
~CbmMcbmCheckTimingTask()
Definition: CbmMcbmCheckTimingTask.cxx:31
CbmMcbmCheckTimingAlgo::AddCheckDetector
void AddCheckDetector(ECbmModuleId detIn, std::string sNameIn, Double_t dTimeRangeBegIn=-1000.0, Double_t dTimeRangeEndIn=1000.0, UInt_t uRangeNbBinsIn=320, UInt_t uChargeCutMinIn=0, UInt_t uChargeCutMaxIn=0)
Definition: CbmMcbmCheckTimingAlgo.cxx:457
CbmMcbmCheckTimingTask::SaveHistos
void SaveHistos()
Definition: CbmMcbmCheckTimingTask.cxx:68
CbmMcbmCheckTimingTask::fsOutFileName
TString fsOutFileName
Definition: CbmMcbmCheckTimingTask.h:79
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmMcbmCheckTimingAlgo::SetOutFilename
void SetOutFilename(TString sNameIn)
Definition: CbmMcbmCheckTimingAlgo.h:75
CbmMcbmCheckTimingAlgo
Definition: CbmMcbmCheckTimingAlgo.h:44
CbmMcbmCheckTimingTask::SetParContainers
virtual void SetParContainers()
Definition: CbmMcbmCheckTimingTask.cxx:34
CbmMcbmCheckTimingAlgo::Finish
void Finish()
Definition: CbmMcbmCheckTimingAlgo.cxx:413
CbmMcbmCheckTimingAlgo::ProcessTs
void ProcessTs()
Definition: CbmMcbmCheckTimingAlgo.cxx:178
CbmMcbmCheckTimingTask::AddCheckDetector
void AddCheckDetector(ECbmModuleId detIn, std::string sNameIn, Double_t dTimeRangeBegIn=-1000.0, Double_t dTimeRangeEndIn=1000.0, UInt_t uRangeNbBinsIn=320, UInt_t uChargeCutMinIn=0, UInt_t uChargeCutMaxIn=0)
Definition: CbmMcbmCheckTimingTask.cxx:124
CbmMcbmCheckTimingAlgo::Init
Bool_t Init()
Definition: CbmMcbmCheckTimingAlgo.cxx:52
CbmMcbmCheckTimingTask::CbmMcbmCheckTimingTask
CbmMcbmCheckTimingTask()
CBM headers.
Definition: CbmMcbmCheckTimingTask.cxx:24
CbmMcbmCheckTimingTask::Init
virtual InitStatus Init()
Definition: CbmMcbmCheckTimingTask.cxx:39