/* History of cvs commits:
*
* $Log$
+ * Revision 1.98 2007/09/26 14:22:17 cvetan
+ * Important changes to the reconstructor classes. Complete elimination of the run-loaders, which are now steered only from AliReconstruction. Removal of the corresponding Reconstruct() and FillESD() methods.
+ *
* Revision 1.97 2007/08/07 14:12:03 kharlov
* Quality assurance added (Yves Schutz)
*
fManager = 0 ; // We work in the standalong mode
//Initialize the quality assurance data maker only once
fQADM = new AliPHOSQualAssDataMaker() ;
- GetQualAssDataMaker()->Init(AliQualAss::kDIGITS) ;
+ //FIXME: get the run number
+ Int_t run = 0 ;
+ //EMXIF
+ GetQualAssDataMaker()->Init(AliQualAss::kDIGITS, run, fgkCycles) ;
+ GetQualAssDataMaker()->StartOfCycle(AliQualAss::kDIGITS) ;
}
//____________________________________________________________________________
SetName(d.GetName()) ;
SetTitle(d.GetTitle()) ;
//Initialize the quality assurance data maker only once
- GetQualAssDataMaker()->Init(AliQualAss::kDIGITS) ;
+ //FIXME: get the run number
+ Int_t run = 0 ;
+ //EMXIF
+ GetQualAssDataMaker()->Init(AliQualAss::kDIGITS, run, fgkCycles) ;
+ GetQualAssDataMaker()->StartOfCycle(AliQualAss::kDIGITS) ;
}
//____________________________________________________________________________
fDefaultInit = kFALSE ;
//Initialize the quality assurance data maker only once
fQADM = new AliPHOSQualAssDataMaker() ;
- GetQualAssDataMaker()->Init(AliQualAss::kDIGITS) ;
+ //FIXME: get the run number
+ Int_t run = 0 ;
+ //EMXIF
+ GetQualAssDataMaker()->Init(AliQualAss::kDIGITS, run) ;
+ GetQualAssDataMaker()->StartOfCycle(AliQualAss::kDIGITS) ;
}
//____________________________________________________________________________
Digitize(ievent) ; //Add prepared SDigits to digits and add the noise
//makes the quality assurance data
+ if (GetQualAssDataMaker()->IsCycleDone() ) {
+ GetQualAssDataMaker()->EndOfCycle(AliQualAss::kDIGITS) ;
+ GetQualAssDataMaker()->StartOfCycle(AliQualAss::kDIGITS) ;
+ }
GetQualAssDataMaker()->Exec(AliQualAss::kDIGITS, gime->Digits()) ;
+ GetQualAssDataMaker()->Increment() ;
WriteDigits() ;
}
//Write the quality assurance data only after the last event
- if ( fEventCounter == gime->MaxEvent() )
+ if ( fEventCounter == gime->MaxEvent() ) {
+ GetQualAssDataMaker()->EndOfCycle(AliQualAss::kDIGITS) ;
GetQualAssDataMaker()->Finish(AliQualAss::kDIGITS) ;
+ }
gime->PhosLoader()->CleanDigitizer();
/* History of cvs commits:
*
* $Log$
+ * Revision 1.35 2007/08/07 14:12:03 kharlov
+ * Quality assurance added (Yves Schutz)
+ *
* Revision 1.34 2006/04/29 20:25:30 hristov
* Decalibration is implemented (Yu.Kharlov)
*
Int_t fLastEvent; // last event to process
AliPHOSQualAssDataMaker * fQADM ; //!Quality Assurance Data Maker
Int_t fEventCounter ; //! counts the events processed
+
+ //QA stuff
+ static const Int_t fgkCycles = 9999 ; // QA data accumulation cycle
- ClassDef(AliPHOSDigitizer,3) // description
+ ClassDef(AliPHOSDigitizer,4) // description
};
AliQualAssDataMaker(AliQualAss::GetDetName(AliQualAss::kPHOS), "PHOS Quality Assurance Data Maker")
{
// ctor
- fDetectorDir = fOutput->GetDirectory(GetName()) ;
- if (!fDetectorDir)
- fDetectorDir = fOutput->mkdir(GetName()) ;
}
//____________________________________________________________________________
return *this;
}
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::EndOfDetectorCycle()
+{
+ //Detector specific actions at end of cycle
+}
+
//____________________________________________________________________________
void AliPHOSQualAssDataMaker::InitESDs()
{
// }
//____________________________________________________________________________
-void AliPHOSQualAssDataMaker::MakeRaws(TTree * clustersTree)
+void AliPHOSQualAssDataMaker::MakeRaws(TObject * data)
{
GetRawsData(1)->Fill(99) ;
}
// fhTrackSegments->Fill( ts->GetCpvDistance()) ;
// }
// }
+
+//____________________________________________________________________________
+void AliPHOSQualAssDataMaker::StartOfDetectorCycle()
+{
+ //Detector specific actions at start of cycle
+
+}
virtual ~AliPHOSQualAssDataMaker() {;} // dtor
private:
+ virtual void EndOfDetectorCycle() ;
virtual void InitHits() ;
virtual void InitESDs() ;
virtual void InitDigits() ;
virtual void MakeDigits(TObject * digits) ;
// virtual void MakeRecParticles(TTree * recpar) ;
virtual void MakeRecPoints(TTree * recpo) ;
- virtual void MakeRaws(TTree * recpo) ;
+ virtual void MakeRaws(TObject * data) ;
virtual void MakeSDigits(TObject * sigits) ;
//virtual void MakeTrackSegments(TTree *ts ) ;
-
+ virtual void StartOfDetectorCycle() ;
+
ClassDef(AliPHOSQualAssDataMaker,1) // description
};
* Permission to use, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
* without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
+ * copies and that both the copyright notice and this permission notice *Ă„Qual * appear in the supporting documentation. The authors make no claims *
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
/* History of cvs commits:
*
* $Log$
+ * Revision 1.52 2007/09/26 14:22:18 cvetan
+ * Important changes to the reconstructor classes. Complete elimination of the run-loaders, which are now steered only from AliReconstruction. Removal of the corresponding Reconstruct() and FillESD() methods.
+ *
* Revision 1.51 2007/08/07 14:12:03 kharlov
* Quality assurance added (Yves Schutz)
*
InitParameters() ;
Init();
fDefaultInit = kFALSE ;
- // Intialize the quality assurance data maker
- GetQualAssDataMaker()->Init(AliQualAss::kHITS) ;
- GetQualAssDataMaker()->Init(AliQualAss::kSDIGITS) ;
+ // Intialize the quality assurance data maker
+ //FIXME: get the run number
+ Int_t run = 0 ;
+ //EMXIF
+ GetQualAssDataMaker()->Init(AliQualAss::kHITS, run, fgkCycles) ;
+ GetQualAssDataMaker()->StartOfCycle(AliQualAss::kHITS) ;
+ GetQualAssDataMaker()->Init(AliQualAss::kSDIGITS, run) ;
+ GetQualAssDataMaker()->StartOfCycle(AliQualAss::kSDIGITS, "same") ;
}
//____________________________________________________________________________
{
// cpy ctor
// Intialize the quality assurance data maker
- GetQualAssDataMaker()->Init(AliQualAss::kHITS) ;
- GetQualAssDataMaker()->Init(AliQualAss::kSDIGITS) ;
+ //FIXME: get the run number
+ Int_t run = 0 ;
+ //EMXIF
+ GetQualAssDataMaker()->Init(AliQualAss::kHITS, run, fgkCycles) ;
+ GetQualAssDataMaker()->StartOfCycle(AliQualAss::kHITS) ;
+ GetQualAssDataMaker()->Init(AliQualAss::kSDIGITS, run) ;
+ GetQualAssDataMaker()->StartOfCycle(AliQualAss::kSDIGITS, "same") ;
}
-
//_____________________________________________________________________________
AliPHOSSDigitizer& AliPHOSSDigitizer::operator = (const AliPHOSSDigitizer& qa)
{
// make Quality Assurance data
+ if (GetQualAssDataMaker()->IsCycleDone() ) {
+ GetQualAssDataMaker()->EndOfCycle(AliQualAss::kHITS) ;
+ GetQualAssDataMaker()->EndOfCycle(AliQualAss::kSDIGITS) ;
+ GetQualAssDataMaker()->StartOfCycle(AliQualAss::kHITS) ;
+ GetQualAssDataMaker()->StartOfCycle(AliQualAss::kSDIGITS, "same") ;
+ }
GetQualAssDataMaker()->Exec(AliQualAss::kHITS, hits) ;
GetQualAssDataMaker()->Exec(AliQualAss::kSDIGITS, sdigits) ;
-
-
+ GetQualAssDataMaker()->Increment() ;
+
//Now write SDigits
}// event loop
//Write the quality assurance data
+ GetQualAssDataMaker()->EndOfCycle(AliQualAss::kHITS) ;
+ GetQualAssDataMaker()->EndOfCycle(AliQualAss::kSDIGITS) ;
GetQualAssDataMaker()->Finish(AliQualAss::kHITS) ;
GetQualAssDataMaker()->Finish(AliQualAss::kSDIGITS) ;
/* History of cvs commits:
*
* $Log$
+ * Revision 1.27 2007/08/07 14:12:03 kharlov
+ * Quality assurance added (Yves Schutz)
+ *
* Revision 1.26 2006/08/28 10:01:56 kharlov
* Effective C++ warnings fixed (Timur Pocheptsov)
*
Int_t fSDigitsInRun ; //! Total number of sdigits in one run
Int_t fFirstEvent; // first event to process
Int_t fLastEvent; // last event to process
+
AliPHOSQualAssDataMaker * fQADM ; //!Quality Assurance Data Maker
+ static const Int_t fgkCycles = 9999 ; // QA data accumulation cycle
- ClassDef(AliPHOSSDigitizer,3) // description
+ ClassDef(AliPHOSSDigitizer,4) // description
};
AliQualAss * AliQualAss::fgQA = 0x0 ;
TFile * AliQualAss::fgDataFile = 0x0 ;
- TString AliQualAss::fgDataName = "QA.root" ;
+ TString AliQualAss::fgDataName = "QAData" ;
TString AliQualAss::fgDetNames[] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD",
"ZDC", "PMD", "T0", "VZERO", "ACORDE", "HLT"} ;
- TString AliQualAss::fgTaskNames[] = {"Hits", "SDigits", "Digits", "RecPoints", "TrackSegments", "RecParticles", "ESDs"} ;
+ TString AliQualAss::fgTaskNames[] = {"Raws", "Hits", "SDigits", "Digits", "RecPoints", "TrackSegments", "RecParticles", "ESDs"} ;
//____________________________________________________________________________
AliQualAss::AliQualAss() :
//_______________________________________________________________
-TFile * AliQualAss::GetQADMOutFile()
+TFile * AliQualAss::GetQADMOutFile(Int_t run, Int_t cycle)
{
// opens the file to store the detectors Quality Assurance Data Maker results
-
+ char temp[100] ;
+ sprintf(temp, "%s_%d_%d.root", fgDataName.Data(), run, cycle) ;
+ TString opt ;
if (! fgDataFile ) {
- TString opt ;
- if (gSystem->AccessPathName(fgDataName.Data()))
+ if (gSystem->AccessPathName(temp))
+ opt = "NEW" ;
+ else
+ opt = "UPDATE" ;
+ fgDataFile = TFile::Open(temp, opt.Data()) ;
+ } else {
+ if ( (strcmp(temp, fgDataFile->GetName()) != 0) ) {
+ if (gSystem->AccessPathName(temp))
opt = "NEW" ;
else
opt = "UPDATE" ;
-
- fgDataFile = TFile::Open(fgDataName.Data(), opt.Data()) ;
+ fgDataFile = TFile::Open(temp, opt.Data()) ;
+ }
}
return fgDataFile ;
}
static const TString GetDetName(DETECTORINDEX det) { return fgDetNames[det] ; }
static const TString GetTaskName(TASKINDEX tsk) { return fgTaskNames[tsk] ; }
static const char * GetDetName(Int_t det) ;
- static TFile * GetQADMOutFile() ;
+ static TFile * GetQADMOutFile(Int_t run, Int_t cycle) ;
void Set(QABIT bit) ;
void Show() const { ShowStatus(fDet) ; }
void ShowAll() const ;
fHitsQAList(0x0),
fRawsQAList(0x0),
fRecPointsQAList(0x0),
- fSDigitsQAList(0x0)
+ fSDigitsQAList(0x0),
+ fCurrentCycle(-1),
+ fCycle(9999999),
+ fCycleCounter(0),
+ fRun(0)
{
// ctor
TString tmp(GetName()) ;
tmp.Append("QA") ;
SetName(tmp.Data()) ;
- fOutput = AliQualAss::GetQADMOutFile() ;
fDetectorDirName = GetName() ;
}
fHitsQAList(qadm.fHitsQAList),
fRawsQAList(qadm.fRecPointsQAList),
fRecPointsQAList(qadm.fRecPointsQAList),
- fSDigitsQAList(qadm.fSDigitsQAList)
+ fSDigitsQAList(qadm.fSDigitsQAList),
+ fCurrentCycle(qadm.fCurrentCycle),
+ fCycle(qadm.fCycle),
+ fCycleCounter(qadm.fCycleCounter),
+ fRun(qadm.fRun)
{
//copy ctor
fDetectorDirName = GetName() ;
return *this;
}
+//____________________________________________________________________________
+void AliQualAssDataMaker::EndOfCycle(AliQualAss::TASKINDEX task)
+{
+ // Finishes a cycle of QA data acquistion
+
+ EndOfDetectorCycle() ;
+ TDirectory * subDir = fDetectorDir->GetDirectory(AliQualAss::GetTaskName(task)) ;
+
+ switch (task) {
+
+ case AliQualAss::kRAWS:
+ subDir->cd() ;
+ fRawsQAList->Write() ;
+ break ;
+
+ case AliQualAss::kHITS:
+ subDir->cd() ;
+ fHitsQAList->Write() ;
+ break ;
+
+ case AliQualAss::kSDIGITS:
+ subDir->cd() ;
+ fSDigitsQAList->Write() ;
+ break ;
+
+ case AliQualAss::kDIGITS:
+ subDir->cd() ;
+ fDigitsQAList->Write() ;
+ break ;
+
+ case AliQualAss::kRECPOINTS:
+ subDir->cd() ;
+ fRecPointsQAList->Write() ;
+ break ;
+
+ case AliQualAss::kTRACKSEGMENTS:
+ break ;
+
+ case AliQualAss::kRECPARTICLES:
+ break ;
+
+ case AliQualAss::kESDS:
+ subDir->cd() ;
+ fESDsQAList->Write() ;
+ break ;
+ }
+}
+
//____________________________________________________________________________
void AliQualAssDataMaker::Exec(AliQualAss::TASKINDEX task, TObject * data)
{
// creates the quality assurance data for the various tasks (Hits, SDigits, Digits, ESDs)
-
- fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
- if (!fDetectorDir)
- fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
-
+
switch (task) {
case AliQualAss::kRAWS:
else
AliError("Wrong type of esd container") ;
break ;
- }
+ }
}
//____________________________________________________________________________
-void AliQualAssDataMaker::Finish(AliQualAss::TASKINDEX task) const
+void AliQualAssDataMaker::Finish(AliQualAss::TASKINDEX) const
{
- // write to the output File
-
- fDetectorDir->cd() ;
- TDirectory * subDir = 0x0 ;
-
-// switch (task) {
-// case AliQualAss::kHITS:
- subDir = fDetectorDir->GetDirectory(AliQualAss::GetTaskName(task)) ;
-// break ;
-
-// case AliQualAss::kSDIGITS:
-// subDir = fDetectorDir->GetDirectory("SDigits") ;
-// break ;
-
-// case AliQualAss::kDIGITS:
-// subDir = fDetectorDir->GetDirectory("Digits") ;
-// break ;
-
-// case AliQualAss::kRECPOINTS:
-// subDir = fDetectorDir->GetDirectory("RecPoints") ;
-// break ;
-
-// case AliQualAss::kTRACKSEGMENTS:
-// subDir = fDetectorDir->GetDirectory("TrackSegments") ;
-// break ;
-
-// case AliQualAss::kRECPARTICLES:
-// subDir = fDetectorDir->GetDirectory("RecParticles") ;
-// break ;
-
-// case AliQualAss::kESDS:
-// subDir = fDetectorDir->GetDirectory("ESDs") ;
-// break ;
-// }
- subDir->Write() ;
+ // write to the output File
}
//____________________________________________________________________________
-TList * AliQualAssDataMaker::Init(AliQualAss::TASKINDEX task)
+TList * AliQualAssDataMaker::Init(AliQualAss::TASKINDEX task, Int_t run, Int_t cycles)
{
// general intialisation
- TDirectory * subDir = 0x0 ;
+ fRun = run ;
+ if (cycles > 0)
+ SetCycle(cycles) ;
+
switch (task) {
case AliQualAss::kRAWS:
- subDir = fDetectorDir->GetDirectory("Raws") ;
- if (!subDir)
- subDir = fDetectorDir->mkdir("Raws") ;
- subDir->cd() ;
fRawsQAList = new TList() ;
InitRaws() ;
return fRawsQAList ;
break ;
case AliQualAss::kHITS:
- subDir = fDetectorDir->GetDirectory("Hits") ;
- if (!subDir)
- subDir = fDetectorDir->mkdir("Hits") ;
- subDir->cd() ;
fHitsQAList = new TList() ;
InitHits() ;
return fHitsQAList ;
break ;
case AliQualAss::kSDIGITS:
- subDir = fDetectorDir->GetDirectory("SDigits") ;
- if (!subDir)
- subDir = fDetectorDir->mkdir("SDigits") ;
- subDir->cd() ;
fSDigitsQAList = new TList() ;
InitSDigits() ;
return fSDigitsQAList ;
break ;
case AliQualAss::kDIGITS:
- subDir = fDetectorDir->GetDirectory("Digits") ;
- if (!subDir)
- subDir = fDetectorDir->mkdir("Digits") ;
- subDir->cd() ;
fDigitsQAList = new TList();
InitDigits() ;
return fDigitsQAList ;
break ;
case AliQualAss::kRECPOINTS:
- subDir = fDetectorDir->GetDirectory("RecPoints") ;
- if(!subDir)
- subDir = fDetectorDir->mkdir("RecPoints") ;
- subDir->cd() ;
fRecPointsQAList = new TList ;
InitRecPoints() ;
return fRecPointsQAList ;
break ;
case AliQualAss::kTRACKSEGMENTS:
-// subDir = fDetectorDir->GetDirectory("TrackSegments") ;
-// if (!subDir)
-// subDir = fDetectorDir->mkdir("TrackSegments") ;
-// subDir->cd() ;
// InitTrackSegments() ;
break ;
case AliQualAss::kRECPARTICLES:
-// subDir = fDetectorDir->GetDirectory("RecParticles") ;
-// if (!subDir)
-// subDir = fDetectorDir->mkdir("RecParticles") ;
-// subDir->cd() ;
// InitRecParticles() ;
break ;
case AliQualAss::kESDS:
- subDir = fDetectorDir->GetDirectory("ESDs") ;
- if (!subDir)
- subDir = fDetectorDir->mkdir("ESDs") ;
- subDir->cd() ;
fESDsQAList = new TList() ;
InitESDs() ;
return fRecPointsQAList ;
}
return 0x0 ;
}
+
+//____________________________________________________________________________
+void AliQualAssDataMaker::StartOfCycle(AliQualAss::TASKINDEX task, Option_t * sameCycle)
+{
+ // Finishes a cycle of QA data acquistion
+
+ if ( (strcmp(sameCycle, "same") != 0) ) {
+ fCurrentCycle++ ;
+ ResetCycle() ;
+ } else if ( !(strcmp(sameCycle, "") != 0) )
+ AliFatal(Form("%s is an invalid option, valid options are: same", sameCycle)) ;
+
+ fOutput = AliQualAss::GetQADMOutFile(fRun, fCurrentCycle) ;
+
+ AliInfo(Form(" Run %d Cycle %d task %s file %s",
+ fRun, fCurrentCycle, AliQualAss::GetTaskName(task).Data(), fOutput->GetName() )) ;
+
+ fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ;
+ if (!fDetectorDir)
+ fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ;
+
+ TDirectory * subDir = fDetectorDir->GetDirectory(AliQualAss::GetTaskName(task)) ;
+ if (!subDir)
+ subDir = fDetectorDir->mkdir(AliQualAss::GetTaskName(task)) ;
+ subDir->cd() ;
+
+ TList * list = 0x0 ;
+
+ switch (task) {
+ case AliQualAss::kRAWS:
+ list = fRawsQAList ;
+ break ;
+
+ case AliQualAss::kHITS:
+ list = fHitsQAList ;
+ break ;
+
+ case AliQualAss::kSDIGITS:
+ list = fSDigitsQAList ;
+ break ;
+
+ case AliQualAss::kDIGITS:
+ list = fDigitsQAList ;
+ break ;
+
+ case AliQualAss::kRECPOINTS:
+ list = fRecPointsQAList ;
+ break ;
+
+ case AliQualAss::kTRACKSEGMENTS:
+ break ;
+
+ case AliQualAss::kRECPARTICLES:
+ break ;
+
+ case AliQualAss::kESDS:
+ list = fESDsQAList ;
+ break ;
+ }
+
+ TIter next(list) ;
+ TH1 * h ;
+ while ( (h = dynamic_cast<TH1 *>(next())) )
+ h->Reset() ;
+
+ StartOfDetectorCycle() ;
+
+}
virtual ~AliQualAssDataMaker() {;} // dtor
virtual void Exec(AliQualAss::TASKINDEX, TObject * data) ;
+ void EndOfCycle(AliQualAss::TASKINDEX) ;
void Finish(AliQualAss::TASKINDEX task) const ;
static const char * GetDetectorDirName() { return fDetectorDirName.Data() ; }
- TList * Init(AliQualAss::TASKINDEX) ;
- Int_t Add2DigitsList(TH1 * hist, Int_t index) { return Add2List(hist, index, fDigitsQAList) ; }
- Int_t Add2ESDsList(TH1 * hist, Int_t index) { return Add2List(hist, index, fESDsQAList) ; }
- Int_t Add2HitsList(TH1 * hist, Int_t index) { return Add2List(hist, index, fHitsQAList) ; }
- Int_t Add2RecPointsList(TH1 * hist, Int_t index) { return Add2List(hist, index, fRecPointsQAList) ; }
- Int_t Add2RawsList(TH1 * hist, Int_t index) { return Add2List(hist, index, fRawsQAList) ; }
- Int_t Add2SDigitsList(TH1 * hist, Int_t index) { return Add2List(hist, index, fSDigitsQAList) ; }
+ const Int_t Increment() { return ++fCycleCounter ; }
+ TList * Init(AliQualAss::TASKINDEX, Int_t run, Int_t cycles = -1) ;
+ const Bool_t IsCycleDone() const { return fCycleCounter > fCycle ? kTRUE : kFALSE ; }
+ const Int_t Add2DigitsList(TH1 * hist, Int_t index) { return Add2List(hist, index, fDigitsQAList) ; }
+ const Int_t Add2ESDsList(TH1 * hist, Int_t index) { return Add2List(hist, index, fESDsQAList) ; }
+ const Int_t Add2HitsList(TH1 * hist, Int_t index) { return Add2List(hist, index, fHitsQAList) ; }
+ const Int_t Add2RecPointsList(TH1 * hist, Int_t index) { return Add2List(hist, index, fRecPointsQAList) ; }
+ const Int_t Add2RawsList(TH1 * hist, Int_t index) { return Add2List(hist, index, fRawsQAList) ; }
+ const Int_t Add2SDigitsList(TH1 * hist, Int_t index) { return Add2List(hist, index, fSDigitsQAList) ; }
TH1 * GetDigitsData(Int_t index) { return dynamic_cast<TH1 *>(GetData(fDigitsQAList, index)) ; }
TH1 * GetESDsData(Int_t index) { return dynamic_cast<TH1 *>(GetData(fESDsQAList, index)) ; }
TH1 * GetHitsData(Int_t index) { return dynamic_cast<TH1 *>(GetData(fHitsQAList, index)) ; }
TH1 * GetRecPointsData(Int_t index) { return dynamic_cast<TH1 *>(GetData(fRecPointsQAList, index)) ; }
TH1 * GetRawsData(Int_t index) { return dynamic_cast<TH1 *>(GetData(fRawsQAList, index)) ; }
TH1 * GetSDigitsData(Int_t index) { return dynamic_cast<TH1 *>(GetData(fSDigitsQAList, index)) ; }
+ void SetCycle(Int_t nevts) { fCycle = nevts ; }
+ void StartOfCycle(AliQualAss::TASKINDEX, Option_t * sameCycle = "") ;
protected:
Int_t Add2List(TH1 * hist, Int_t index, TList * list) { list->AddAt(hist, index) ; return list->LastIndex() ; }
+ virtual void EndOfDetectorCycle() {AliInfo("To be implemented by detectors");}
TObject * GetData(TList * list, Int_t index) { return list->At(index) ; }
- virtual void InitDigits() {AliInfo("To ne implemented by detectors");}
- virtual void InitESDs() {AliInfo("To ne implemented by detectors");}
- virtual void InitHits() {AliInfo("To ne implemented by detectors");}
- //virtual void InitRecParticles() {AliInfo("To ne implemented by detectors");}
- virtual void InitRecPoints() {AliInfo("To ne implemented by detectors");}
- virtual void InitRaws() {AliInfo("To ne implemented by detectors");}
- virtual void InitSDigits() {AliInfo("To ne implemented by detectors");}
+ virtual void InitDigits() {AliInfo("To be implemented by detectors");}
+ virtual void InitESDs() {AliInfo("To be implemented by detectors");}
+ virtual void InitHits() {AliInfo("To be implemented by detectors");}
+ //virtual void InitRecParticles() {AliInfo("To be implemented by detectors");}
+ virtual void InitRecPoints() {AliInfo("To be implemented by detectors");}
+ virtual void InitRaws() {AliInfo("To be implemented by detectors");}
+ virtual void InitSDigits() {AliInfo("To be implemented by detectors");}
//virtual void InitTrackSegments() {AliInfo("To ne implemented by detectors");}
- virtual void MakeESDs(AliESDEvent * ) {AliInfo("To ne implemented by detectors");}
- virtual void MakeHits(TObject * ) {AliInfo("To ne implemented by detectors");}
- virtual void MakeDigits(TObject * ) {AliInfo("To ne implemented by detectors");}
- // virtual void MakeRecParticles(TClonesArray * ) {AliInfo("To ne implemented by detectors");}
- virtual void MakeRaws(TObject * ) {AliInfo("To ne implemented by detectors");}
- virtual void MakeRecPoints(TTree * ) {AliInfo("To ne implemented by detectors");}
- virtual void MakeSDigits(TObject * ) {AliInfo("To ne implemented by detectors");}
- //virtual void MakeTrackSegments(TTree * ) {AliInfo("To ne implemented by detectors");}
+ virtual void MakeESDs(AliESDEvent * ) {AliInfo("To be implemented by detectors");}
+ virtual void MakeHits(TObject * ) {AliInfo("To be implemented by detectors");}
+ virtual void MakeDigits(TObject * ) {AliInfo("To be implemented by detectors");}
+ // virtual void MakeRecParticles(TClonesArray * ) {AliInfo("To be implemented by detectors");}
+ virtual void MakeRaws(TObject * ) {AliInfo("To be implemented by detectors");}
+ virtual void MakeRecPoints(TTree * ) {AliInfo("To be implemented by detectors");}
+ virtual void MakeSDigits(TObject * ) {AliInfo("To be implemented by detectors");}
+ //virtual void MakeTrackSegments(TTree * ) {AliInfo("To be implemented by detectors");}
+ void ResetCycle() { fCycleCounter = 0 ; }
+ virtual void StartOfDetectorCycle() {AliInfo("To be implemented by detectors");}
TFile * fOutput ; //! output root file
TDirectory * fDetectorDir ; //! directory for the given detector in the file
TList * fRawsQAList ; //! list of the raws QA data objects
TList * fRecPointsQAList ; //! list of the recpoints QA data objects
TList * fSDigitsQAList ; //! list of the sdigits QA data objects
+ Int_t fCurrentCycle ; //! current cycle number
+ Int_t fCycle ; //! length (# events) of the QA data acquisition cycle
+ Int_t fCycleCounter ; //! cycle counter
+ Int_t fRun ; //! run number
ClassDef(AliQualAssDataMaker,1) // description
};
fLoader[iDet] = NULL;
fTracker[iDet] = NULL;
fQualAssDataMaker[iDet] = NULL;
+ fQACycles[iDet] = 999999;
}
AliPID pid;
}
fLoader[iDet] = NULL;
fTracker[iDet] = NULL;
fQualAssDataMaker[iDet] = NULL;
+ fQACycles[iDet] = rec.fQACycles[iDet];
}
for (Int_t i = 0; i < rec.fSpecCDBUri.GetEntriesFast(); i++) {
if (rec.fSpecCDBUri[i]) fSpecCDBUri.Add(rec.fSpecCDBUri[i]->Clone());
continue;
AliQualAssDataMaker * qadm = GetQualAssDataMaker(iDet);
if (!qadm) continue;
+ qadm->EndOfCycle(AliQualAss::kRECPOINTS);
+ qadm->EndOfCycle(AliQualAss::kESDS);
qadm->Finish(AliQualAss::kRECPOINTS);
qadm->Finish(AliQualAss::kESDS) ;
}
if (qadm) {
AliCodeTimerStart(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
AliInfo(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
+
+ if (qadm->IsCycleDone() ) {
+ qadm->EndOfCycle(AliQualAss::kRECPOINTS) ;
+ qadm->EndOfCycle(AliQualAss::kESDS) ;
+ qadm->StartOfCycle(AliQualAss::kRECPOINTS) ;
+ qadm->StartOfCycle(AliQualAss::kESDS, "same") ;
+ }
qadm->Exec(AliQualAss::kRECPOINTS, clustersTree) ;
AliCodeTimerStop(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
}
}
if (qadm) {
AliInfo(Form("Initializing quality assurance data maker for %s", fgkDetectorName[iDet]));
- qadm->Init(AliQualAss::kRECPOINTS);
- qadm->Init(AliQualAss::kESDS) ;
+ //FIXME: get the run number
+ Int_t run = 0 ;
+ //EMXIF
+ qadm->Init(AliQualAss::kRECPOINTS, run, GetQACycles(fgkDetectorName[iDet]));
+ qadm->Init(AliQualAss::kESDS, run) ;
+ qadm->StartOfCycle(AliQualAss::kRECPOINTS);
+ qadm->StartOfCycle(AliQualAss::kESDS, "same") ;
fQualAssDataMaker[iDet] = qadm;
}
AliInfo(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
qadm->Exec(AliQualAss::kESDS, esd) ;
+ qadm->Increment() ;
AliCodeTimerStop(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
}
return kTRUE;
}
+
+//_____________________________________________________________________________
+Int_t AliReconstruction::GetDetIndex(const char* detector)
+{
+ // return the detector index corresponding to detector
+ Int_t index = -1 ;
+ for (index = 0; index < fgkNDetectors ; index++) {
+ if ( strcmp(detector, fgkDetectorName[index]) == 0 )
+ break ;
+ }
+ return index ;
+}
// Quality Assurance
virtual Bool_t RunQualAss(const char* detectors, AliESDEvent *& esd);
+ void SetQACycles(const char * detector, const Int_t cycles) { fQACycles[GetDetIndex(detector)] = cycles ; }
private:
Bool_t RunLocalReconstruction(const TString& detectors);
void FillRawDataErrorLog(Int_t iEvent, AliESDEvent* esd);
//Quality Assurance
+ Int_t GetDetIndex(const char * detector);
AliQualAssDataMaker* GetQualAssDataMaker(Int_t iDet);
+ const Int_t GetQACycles(const char * detector) { return fQACycles[GetDetIndex(detector)] ; }
//*** Global reconstruction flags *******************
Bool_t fUniformField; // uniform field tracking flag
//Quality Assurance
AliQualAssDataMaker * fQualAssDataMaker[fgkNDetectors]; //! array of QA data maker objects
+ Int_t fQACycles[fgkNDetectors] ; // cycle length (# events) over which QA data are accumulated
- ClassDef(AliReconstruction, 13) // class for running the reconstruction
+ ClassDef(AliReconstruction, 14) // class for running the reconstruction
};
#endif
ClassImp(AliSimulation)
AliSimulation *AliSimulation::fgInstance = 0;
+const char* AliSimulation::fgkDetectorName[AliSimulation::fgkNDetectors] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "ACORDE", "HLT"};
//_____________________________________________________________________________
AliSimulation::AliSimulation(const char* configFileName, const char* cdbUri,
// create simulation object with default parameters
fgInstance = this;
SetGAliceFile("galice.root");
+
+// for QA
+ for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++)
+ fQACycles[iDet] = 999999;
}
//_____________________________________________________________________________
if (sim.fSpecCDBUri[i]) fSpecCDBUri.Add(sim.fSpecCDBUri[i]->Clone());
}
fgInstance = this;
+
+// for QA
+ for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++)
+ fQACycles[iDet] = sim.fQACycles[iDet];
}
//_____________________________________________________________________________
if (IsSelected(det->GetName(), detStr)) {
AliInfo(Form("creating summable digits for %s", det->GetName()));
AliCodeTimerAuto(Form("creating summable digits for %s", det->GetName()));
+
det->Hits2SDigits();
}
}
}
} // detectors
+
//
// If ESD information available obtain reconstructed vertex and store in header.
if (esdOK) {
return kTRUE;
}
+
+//_____________________________________________________________________________
+Int_t AliSimulation::GetDetIndex(const char* detector)
+{
+ // return the detector index corresponding to detector
+ Int_t index = -1 ;
+ for (index = 0; index < fgkNDetectors ; index++) {
+ if ( strcmp(detector, fgkDetectorName[index]) == 0 )
+ break ;
+ }
+ return index ;
+}
virtual Bool_t ConvertDateToRoot(const char* dateFileName = "raw.date",
const char* rootFileName = "raw.root");
virtual Bool_t ConvertRaw2SDigits(const char* rawDirectory, const char* esdFile = "");
-
+
+ //Quality Assurance
+ Int_t GetDetIndex(const char * detector);
+ const Int_t GetQACycles(const char * detector) { return fQACycles[GetDetIndex(detector)] ; }
+ void SetQACycles(const char * detector, const Int_t cycles) { fQACycles[GetDetIndex(detector)] = cycles ; }
+
private:
AliRunLoader* LoadRun(const char* mode = "UPDATE") const;
Int_t GetNSignalPerBkgrd(Int_t nEvents = 0) const;
TString fRemoteCDBUri; // Uri of the remote CDB storage
TObjArray fSpecCDBUri; // Array with detector specific CDB storages
Bool_t fEmbeddingFlag; // Flag for embedding
- ClassDef(AliSimulation, 4) // class for running generation, simulation and digitization
+
+ //QA stuff
+ static const Int_t fgkNDetectors = 15 ; // number of detectors
+ static const char * fgkDetectorName[fgkNDetectors] ; // names of detectors
+ Int_t fQACycles[fgkNDetectors] ; // cycle length (# events) over which QA data are accumulated
+
+
+ ClassDef(AliSimulation, 5) // class for running generation, simulation and digitization
};
#endif