From f21fc003c20acf4ef162ab5c82e902915a6c92f0 Mon Sep 17 00:00:00 2001 From: hristov Date: Sun, 23 Oct 2011 15:46:57 +0000 Subject: [PATCH] Removing the tasks from the digitization (Ruben) --- ACORDE/AliACORDE.cxx | 4 +- ACORDE/AliACORDE.h | 2 +- ACORDE/AliACORDEDigitizer.cxx | 14 +- ACORDE/AliACORDEDigitizer.h | 6 +- ACORDE/AliACORDERawReader.cxx | 2 +- ACORDE/AliACORDERawReader.h | 8 +- EMCAL/AliEMCAL.cxx | 12 +- EMCAL/AliEMCAL.h | 3 +- EMCAL/AliEMCALDigitizer.cxx | 547 +++++++++--------- EMCAL/AliEMCALDigitizer.h | 10 +- EMCAL/AliEMCALLoader.h | 1 - EMCAL/AliEMCALPID.h | 1 - EMCAL/AliEMCALPIDUtils.h | 6 +- EMCAL/AliEMCALSDigitizer.cxx | 42 +- EMCAL/AliEMCALSDigitizer.h | 12 +- FMD/AliFMD.cxx | 12 +- FMD/AliFMD.h | 6 +- FMD/AliFMDBaseDigitizer.cxx | 6 +- FMD/AliFMDBaseDigitizer.h | 6 +- FMD/AliFMDDigitizer.cxx | 22 +- FMD/AliFMDDigitizer.h | 10 +- FMD/AliFMDHitDigitizer.cxx | 2 +- FMD/AliFMDHitDigitizer.h | 2 +- HMPID/AliHMPIDDigitizer.cxx | 14 +- HMPID/AliHMPIDDigitizer.h | 6 +- HMPID/AliHMPIDPid.cxx | 2 +- HMPID/AliHMPIDPid.h | 5 +- HMPID/AliHMPIDRecon.cxx | 2 +- HMPID/AliHMPIDRecon.h | 6 +- HMPID/AliHMPIDReconHTA.cxx | 2 +- HMPID/AliHMPIDReconHTA.h | 6 +- HMPID/AliHMPIDv1.h | 2 +- HMPID/AliHMPIDv2.h | 2 +- HMPID/AliHMPIDv3.h | 2 +- ITS/AliITS.cxx | 6 +- ITS/AliITS.h | 4 +- ITS/AliITSDigitizer.cxx | 22 +- ITS/AliITSDigitizer.h | 8 +- ITS/AliITSreconstruction.h | 6 +- ITS/AliITSsDigitize.cxx | 4 +- ITS/AliITSsDigitize.h | 8 +- ITS/UPGRADE/AliITSUpg.cxx | 4 +- ITS/UPGRADE/AliITSUpg.h | 4 +- ITS/UPGRADE/AliITSupgrade.h | 2 +- ITS/UPGRADE/AliITSupgradeDigitizer.cxx | 16 +- ITS/UPGRADE/AliITSupgradeDigitizer.h | 4 +- MFT/AliMFT.h | 2 +- MFT/AliMFTDigitizer.cxx | 18 +- MFT/AliMFTDigitizer.h | 6 +- MUON/AliMUON.cxx | 8 +- MUON/AliMUON.h | 2 +- MUON/AliMUONDigitizerV3.cxx | 30 +- MUON/AliMUONDigitizerV3.h | 4 +- MUON/AliMUONSDigitizerV2.cxx | 4 +- MUON/AliMUONSDigitizerV2.h | 10 +- MUON/Doxymodules_STEER.h | 2 +- PHOS/AliPHOS.cxx | 6 +- PHOS/AliPHOS.h | 3 +- PHOS/AliPHOSDigitizer.cxx | 79 +-- PHOS/AliPHOSDigitizer.h | 6 +- PHOS/AliPHOSLoader.cxx | 2 +- PHOS/AliPHOSLoader.h | 25 +- PHOS/AliPHOSSDigitizer.cxx | 28 +- PHOS/AliPHOSSDigitizer.h | 12 +- PMD/AliPMD.cxx | 4 +- PMD/AliPMD.h | 2 +- PMD/AliPMDDigitizer.cxx | 16 +- PMD/AliPMDDigitizer.h | 6 +- PWG4/PartCorrBase/AliCaloPID.cxx | 3 +- PWG4/PartCorrBase/AliCaloPID.h | 4 +- STEER/AliHMPIDPIDResponse.cxx | 2 +- STEER/AliHMPIDPIDResponse.h | 4 +- STEER/CMakelibSTEER.pkg | 3 +- STEER/STEER/AliConfig.cxx | 169 +----- STEER/STEER/AliConfig.h | 33 +- STEER/STEER/AliDataLoader.cxx | 90 +-- STEER/STEER/AliDataLoader.h | 20 +- ...Digitizer.cxx => AliDigitizationInput.cxx} | 145 ++--- ...iRunDigitizer.h => AliDigitizationInput.h} | 44 +- STEER/STEER/AliDigitizer.cxx | 26 +- STEER/STEER/AliDigitizer.h | 18 +- STEER/STEER/AliLoader.cxx | 304 +--------- STEER/STEER/AliLoader.h | 63 +- STEER/STEER/AliModule.cxx | 7 +- STEER/STEER/AliModule.h | 12 +- STEER/STEER/AliRunLoader.cxx | 63 -- STEER/STEER/AliRunLoader.h | 9 - STEER/STEER/AliSimulation.cxx | 70 ++- STEER/STEER/AliTaskLoader.cxx | 110 ---- STEER/STEER/AliTaskLoader.h | 48 -- STEER/STEERLinkDef.h | 3 +- T0/AliT0.cxx | 4 +- T0/AliT0.h | 2 +- T0/AliT0Digitizer.cxx | 14 +- T0/AliT0Digitizer.h | 6 +- T0/AliT0Loader.cxx | 4 - TOF/AliTOF.cxx | 42 +- TOF/AliTOF.h | 7 +- TOF/AliTOFClusterFinder.cxx | 8 +- TOF/AliTOFClusterFinder.h | 6 +- TOF/AliTOFClusterFinderV1.cxx | 6 +- TOF/AliTOFClusterFinderV1.h | 6 +- TOF/AliTOFDigitizer.cxx | 16 +- TOF/AliTOFDigitizer.h | 6 +- TOF/AliTOFSDigitizer.cxx | 14 +- TOF/AliTOFSDigitizer.h | 10 +- TPC/AliTPC.cxx | 4 +- TPC/AliTPC.h | 2 +- TPC/AliTPCDigitizer.cxx | 70 +-- TPC/AliTPCDigitizer.h | 10 +- TRD/AliTRD.cxx | 4 +- TRD/AliTRD.h | 2 +- TRD/AliTRDdigitizer.cxx | 24 +- TRD/AliTRDdigitizer.h | 8 +- VZERO/AliVZERO.cxx | 10 +- VZERO/AliVZERO.h | 2 +- VZERO/AliVZERODigitizer.cxx | 20 +- VZERO/AliVZERODigitizer.h | 6 +- ZDC/AliZDC.cxx | 4 +- ZDC/AliZDC.h | 2 +- ZDC/AliZDCDigitizer.cxx | 14 +- ZDC/AliZDCDigitizer.h | 6 +- 122 files changed, 829 insertions(+), 1908 deletions(-) rename STEER/STEER/{AliRunDigitizer.cxx => AliDigitizationInput.cxx} (79%) rename STEER/STEER/{AliRunDigitizer.h => AliDigitizationInput.h} (87%) delete mode 100644 STEER/STEER/AliTaskLoader.cxx delete mode 100644 STEER/STEER/AliTaskLoader.h diff --git a/ACORDE/AliACORDE.cxx b/ACORDE/AliACORDE.cxx index 1432368852e..1fcb9766be6 100644 --- a/ACORDE/AliACORDE.cxx +++ b/ACORDE/AliACORDE.cxx @@ -234,11 +234,11 @@ AliLoader* AliACORDE::MakeLoader(const char* topfoldername) } -AliDigitizer* AliACORDE::CreateDigitizer(AliRunDigitizer* manager) const +AliDigitizer* AliACORDE::CreateDigitizer(AliDigitizationInput* digInput) const { // // - return new AliACORDEDigitizer(manager); + return new AliACORDEDigitizer(digInput); } void AliACORDE::Digits2Raw() diff --git a/ACORDE/AliACORDE.h b/ACORDE/AliACORDE.h index b77606adc70..7631e08bd56 100644 --- a/ACORDE/AliACORDE.h +++ b/ACORDE/AliACORDE.h @@ -33,7 +33,7 @@ public: virtual AliLoader* MakeLoader(const char* topfoldername); - AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; + AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const; virtual AliTriggerDetector* CreateTriggerDetector() const { return new AliACORDETrigger(); } diff --git a/ACORDE/AliACORDEDigitizer.cxx b/ACORDE/AliACORDEDigitizer.cxx index 163c4b585e2..ec780d2fedb 100644 --- a/ACORDE/AliACORDEDigitizer.cxx +++ b/ACORDE/AliACORDEDigitizer.cxx @@ -34,7 +34,7 @@ #include "AliACORDEhit.h" #include "AliRunLoader.h" #include "AliLoader.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliCDBManager.h" #include "AliCDBStorage.h" #include "AliCDBEntry.h" @@ -56,8 +56,8 @@ AliACORDEDigitizer::AliACORDEDigitizer() // default constructor } -AliACORDEDigitizer::AliACORDEDigitizer(AliRunDigitizer* manager) - :AliDigitizer(manager), +AliACORDEDigitizer::AliACORDEDigitizer(AliDigitizationInput* digInput) + :AliDigitizer(digInput), fCalibData(GetCalibData()), fNdigits(0), fDigits(0) @@ -89,7 +89,7 @@ Bool_t AliACORDEDigitizer::Init() return kTRUE; } -void AliACORDEDigitizer::Exec(Option_t* /*option*/) +void AliACORDEDigitizer::Digitize(Option_t* /*option*/) { // Creates digits from hits @@ -128,7 +128,7 @@ void AliACORDEDigitizer::Exec(Option_t* /*option*/) // 2.- get loaders AliRunLoader* outRunLoader = - AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); + AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName()); if (!outRunLoader) { Error("Exec", "Can not get output Run Loader"); return;} @@ -146,9 +146,9 @@ void AliACORDEDigitizer::Exec(Option_t* /*option*/) treeD->Branch("ACORDEdigit", &fDigits, bufsize); // 3. loop over inputs - for (Int_t iInput = 0; iInput < fManager->GetNinputs(); iInput++) { + for (Int_t iInput = 0; iInput < fDigInput->GetNinputs(); iInput++) { AliRunLoader* runLoader = - AliRunLoader::GetRunLoader(fManager->GetInputFolderName(iInput)); + AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(iInput)); AliLoader* loader = runLoader->GetLoader("ACORDELoader"); if (!loader) { Error("Exec", "Can not get ACORDE Loader for input %d", iInput); diff --git a/ACORDE/AliACORDEDigitizer.h b/ACORDE/AliACORDEDigitizer.h index 8630a95c938..b510b090d50 100644 --- a/ACORDE/AliACORDEDigitizer.h +++ b/ACORDE/AliACORDEDigitizer.h @@ -16,7 +16,7 @@ #include "AliDigitizer.h" class TClonesArray; -class AliRunDigitizer; +class AliDigitizationInput; class AliCDBManager; class AliCDBStorage; class AliACORDECalibData; @@ -26,11 +26,11 @@ class AliACORDEDigitizer: public AliDigitizer { public: AliACORDEDigitizer() ; // constructor - AliACORDEDigitizer(AliRunDigitizer *manager);// constructor + AliACORDEDigitizer(AliDigitizationInput* digInput);// constructor virtual ~AliACORDEDigitizer() ; // destructor virtual Bool_t Init(); - virtual void Exec(Option_t* option=0); + virtual void Digitize(Option_t* option=0); void AddDigit(Int_t* track, Int_t module, Float_t time); void AddDigit(Int_t* modul, Float_t time); diff --git a/ACORDE/AliACORDERawReader.cxx b/ACORDE/AliACORDERawReader.cxx index 8f0e274de53..c6900f329b4 100755 --- a/ACORDE/AliACORDERawReader.cxx +++ b/ACORDE/AliACORDERawReader.cxx @@ -34,7 +34,7 @@ ClassImp(AliACORDERawReader) AliACORDERawReader::AliACORDERawReader (AliRawReader *rawReader, Bool_t isOnline): - TTask("ACORDERawReader","read raw ACORDE data"), + TNamed("ACORDERawReader","read raw ACORDE data"), fRawReader(rawReader), fData(NULL), fPosition(0), diff --git a/ACORDE/AliACORDERawReader.h b/ACORDE/AliACORDERawReader.h index b92c6dbe7a6..4cdd0f608ce 100755 --- a/ACORDE/AliACORDERawReader.h +++ b/ACORDE/AliACORDERawReader.h @@ -10,18 +10,18 @@ // Mario Rodriguez Cahuantzi // Arturo Fernandez Tellez -#include +#include #include "AliRawReader.h" -class AliACORDERawReader : public TTask { +class AliACORDERawReader : public TNamed { public : AliACORDERawReader(AliRawReader *rawReader,Bool_t isOnline = kFALSE) ; //AliACORDERawReader(AliRawReader *rawReader,Bool_t isOnline = kTRUE) ; virtual ~AliACORDERawReader(); - AliACORDERawReader(const AliACORDERawReader& o): TTask(o),fRawReader(0),fData(NULL),fPosition(0),fIsOnline(kFALSE),fDataSize(0) + AliACORDERawReader(const AliACORDERawReader& o): TNamed(o),fRawReader(0),fData(NULL),fPosition(0),fIsOnline(kFALSE),fDataSize(0) { fWord[0] = fWord[1] = fWord[2] = fWord[3] = 0; } @@ -64,7 +64,7 @@ enum EACORDERawStreamError { kRawDataSizeErr = 1 }; - ClassDef(AliACORDERawReader,2) //class for reading ACORDE Raw data + ClassDef(AliACORDERawReader,3) //class for reading ACORDE Raw data }; typedef AliACORDERawReader AliSTARTRawReader; // for backward compatibility diff --git a/EMCAL/AliEMCAL.cxx b/EMCAL/AliEMCAL.cxx index d9efcc179dd..fd354068ecf 100644 --- a/EMCAL/AliEMCAL.cxx +++ b/EMCAL/AliEMCAL.cxx @@ -100,12 +100,6 @@ AliEMCAL::~AliEMCAL() //dtor delete fgRawUtils; delete fTriggerData; - - AliLoader *emcalLoader=0; - if ((emcalLoader = AliRunLoader::Instance()->GetDetectorLoader("EMCAL"))) - emcalLoader->CleanSDigitizer(); - - } //____________________________________________________________________________ @@ -196,10 +190,10 @@ void AliEMCAL::InitConstants() // } //____________________________________________________________________________ -AliDigitizer* AliEMCAL::CreateDigitizer(AliRunDigitizer* manager) const +AliDigitizer* AliEMCAL::CreateDigitizer(AliDigitizationInput* digInput) const { //create and return the digitizer - return new AliEMCALDigitizer(manager); + return new AliEMCALDigitizer(digInput); } //____________________________________________________________________________ @@ -314,7 +308,7 @@ void AliEMCAL::Hits2SDigits() GetGeometry(); AliEMCALSDigitizer emcalDigitizer(fLoader->GetRunLoader()->GetFileName().Data()) ; emcalDigitizer.SetEventRange(0, -1) ; // do all the events - emcalDigitizer.ExecuteTask() ; + emcalDigitizer.Digitize() ; } //______________________________________________________________________ diff --git a/EMCAL/AliEMCAL.h b/EMCAL/AliEMCAL.h index 4e2ea5a1b64..4da1b44908e 100644 --- a/EMCAL/AliEMCAL.h +++ b/EMCAL/AliEMCAL.h @@ -31,7 +31,6 @@ // --- ROOT system --- class TString ; -class TTask ; class TFolder ; class TRandom ; class TGraph; @@ -57,7 +56,7 @@ class AliEMCAL : public AliDetector { virtual void AddHit(Int_t, Int_t*, Float_t *) { Fatal("AddHit(Int_t, Int_t*, Float_t *", "not to be used: use AddHit( Int_t shunt, Int_t primary, Int_t track,Int_t id, Float_t *hits )") ; } - virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; + virtual AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const; virtual void CreateMaterials() ; virtual void Init() ; virtual void Digits2Raw(); diff --git a/EMCAL/AliEMCALDigitizer.cxx b/EMCAL/AliEMCALDigitizer.cxx index 8a6bc319306..40b4ce9702c 100644 --- a/EMCAL/AliEMCALDigitizer.cxx +++ b/EMCAL/AliEMCALDigitizer.cxx @@ -54,7 +54,7 @@ // --- AliRoot header files --- #include "AliLog.h" #include "AliRun.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliRunLoader.h" #include "AliCDBManager.h" #include "AliCDBEntry.h" @@ -133,16 +133,17 @@ AliEMCALDigitizer::AliEMCALDigitizer() fEventFolderName(""), fFirstEvent(0), fLastEvent(0), - fCalibData(0x0) + fCalibData(0x0), + fSDigitizer(0x0) { // ctor InitParameters() ; - fManager = 0 ; // We work in the standalone mode + fDigInput = 0 ; // We work in the standalone mode } //____________________________________________________________________________ AliEMCALDigitizer::AliEMCALDigitizer(TString alirunFileName, TString eventFolderName) - : AliDigitizer("EMCAL"+AliConfig::Instance()->GetDigitizerTaskName(), alirunFileName), + : AliDigitizer("EMCALDigitizer", alirunFileName), fDefaultInit(kFALSE), fDigitsInRun(0), fInit(0), @@ -165,12 +166,13 @@ AliEMCALDigitizer::AliEMCALDigitizer(TString alirunFileName, TString eventFolder fEventFolderName(eventFolderName), fFirstEvent(0), fLastEvent(0), - fCalibData(0x0) + fCalibData(0x0), + fSDigitizer(0x0) { // ctor InitParameters() ; Init() ; - fManager = 0 ; // We work in the standalone mode + fDigInput = 0 ; // We work in the standalone mode } //____________________________________________________________________________ @@ -197,14 +199,15 @@ AliEMCALDigitizer::AliEMCALDigitizer(const AliEMCALDigitizer & d) fEventFolderName(d.fEventFolderName), fFirstEvent(d.fFirstEvent), fLastEvent(d.fLastEvent), - fCalibData(d.fCalibData) + fCalibData(d.fCalibData), + fSDigitizer(d.fSDigitizer ? new AliEMCALSDigitizer(*d.fSDigitizer) : 0) { // copyy ctor } //____________________________________________________________________________ -AliEMCALDigitizer::AliEMCALDigitizer(AliRunDigitizer * rd) - : AliDigitizer(rd,"EMCAL"+AliConfig::Instance()->GetDigitizerTaskName()), +AliEMCALDigitizer::AliEMCALDigitizer(AliDigitizationInput * rd) + : AliDigitizer(rd,"EMCALDigitizer"), fDefaultInit(kFALSE), fDigitsInRun(0), fInit(0), @@ -227,12 +230,13 @@ AliEMCALDigitizer::AliEMCALDigitizer(AliRunDigitizer * rd) fEventFolderName(0), fFirstEvent(0), fLastEvent(0), - fCalibData(0x0) + fCalibData(0x0), + fSDigitizer(0x0) { // ctor Init() is called by RunDigitizer - fManager = rd ; - fEventFolderName = fManager->GetInputFolderName(0) ; - SetTitle(dynamic_cast(fManager->GetInputStream(0))->GetFileName(0)); + fDigInput = rd ; + fEventFolderName = fDigInput->GetInputFolderName(0) ; + SetTitle(dynamic_cast(fDigInput->GetInputStream(0))->GetFileName(0)); InitParameters() ; } @@ -240,17 +244,9 @@ AliEMCALDigitizer::AliEMCALDigitizer(AliRunDigitizer * rd) AliEMCALDigitizer::~AliEMCALDigitizer() { //dtor - if (AliRunLoader::Instance()) { - AliLoader *emcalLoader=0; - if ((emcalLoader = AliRunLoader::Instance()->GetDetectorLoader("EMCAL"))) - emcalLoader->CleanDigitizer(); - } - else - AliDebug(1," no runloader present"); - delete [] fInputFileNames ; delete [] fEventNames ; - + if (fSDigitizer) delete fSDigitizer; } //____________________________________________________________________________ @@ -274,9 +270,9 @@ void AliEMCALDigitizer::Digitize(Int_t event) if(emcalLoader){ Int_t readEvent = event ; - // fManager is data member from AliDigitizer - if (fManager) - readEvent = dynamic_cast(fManager->GetInputStream(0))->GetCurrentEventNumber() ; + // fDigInput is data member from AliDigitizer + if (fDigInput) + readEvent = dynamic_cast(fDigInput->GetInputStream(0))->GetCurrentEventNumber() ; AliDebug(1,Form("Adding event %d from input stream 0 %s %s", readEvent, GetTitle(), fEventFolderName.Data())) ; rl->GetEvent(readEvent); @@ -301,39 +297,31 @@ void AliEMCALDigitizer::Digitize(Int_t event) digits->Expand(nEMC) ; - // get first the sdigitizer from the tasks list (must have same name as the digitizer) - if ( !emcalLoader->SDigitizer() ) - emcalLoader->LoadSDigitizer(); - AliEMCALSDigitizer * sDigitizer = dynamic_cast(emcalLoader->SDigitizer()); - - if (!sDigitizer ) - { - Fatal("Digitize", "SDigitizer with name %s %s not found", fEventFolderName.Data(), GetTitle() ) ; - } - else - { - - //take all the inputs to add together and load the SDigits - TObjArray * sdigArray = new TObjArray(fInput) ; - sdigArray->AddAt(emcalLoader->SDigits(), 0) ; - Int_t i ; - Int_t embed = kFALSE; - for(i = 1 ; i < fInput ; i++){ - TString tempo(fEventNames[i]) ; - tempo += i ; + // RS create a digitizer on the fly + if (!fSDigitizer) fSDigitizer = new AliEMCALSDigitizer(rl->GetFileName().Data()); + fSDigitizer->SetEventRange(0, -1) ; + // + //take all the inputs to add together and load the SDigits + TObjArray * sdigArray = new TObjArray(fInput) ; + sdigArray->AddAt(emcalLoader->SDigits(), 0) ; + Int_t i ; + Int_t embed = kFALSE; + for(i = 1 ; i < fInput ; i++){ + TString tempo(fEventNames[i]) ; + tempo += i ; - AliRunLoader * rl2 = AliRunLoader::GetRunLoader(tempo) ; + AliRunLoader * rl2 = AliRunLoader::GetRunLoader(tempo) ; - if (rl2==0) - rl2 = AliRunLoader::Open(fInputFileNames[i], tempo) ; + if (rl2==0) + rl2 = AliRunLoader::Open(fInputFileNames[i], tempo) ; - if (fManager) - readEvent = dynamic_cast(fManager->GetInputStream(i))->GetCurrentEventNumber() ; - Info("Digitize", "Adding event %d from input stream %d %s %s", readEvent, i, fInputFileNames[i].Data(), tempo.Data()) ; - rl2->LoadSDigits(); - // rl2->LoadDigits(); - rl2->GetEvent(readEvent); - if(rl2->GetDetectorLoader("EMCAL")) + if (fDigInput) + readEvent = dynamic_cast(fDigInput->GetInputStream(i))->GetCurrentEventNumber() ; + Info("Digitize", "Adding event %d from input stream %d %s %s", readEvent, i, fInputFileNames[i].Data(), tempo.Data()) ; + rl2->LoadSDigits(); + // rl2->LoadDigits(); + rl2->GetEvent(readEvent); + if(rl2->GetDetectorLoader("EMCAL")) { AliEMCALLoader *emcalLoader2 = dynamic_cast(rl2->GetDetectorLoader("EMCAL")); @@ -345,11 +333,11 @@ void AliEMCALDigitizer::Digitize(Int_t event) // Check if first sdigit is of embedded type, if so, handle the sdigits differently: // do not smear energy of embedded, do not add noise to any sdigits if(sdigits2->GetEntriesFast()>0){ - //printf("Merged digit type: %d\n",dynamic_cast (sdigits2->At(0))->GetType()); - AliEMCALDigit * digit2 = dynamic_cast (sdigits2->At(0)); - if(digit2 && digit2->GetType()==AliEMCALDigit::kEmbedded){ - embed = kTRUE; - } + //printf("Merged digit type: %d\n",dynamic_cast (sdigits2->At(0))->GetType()); + AliEMCALDigit * digit2 = dynamic_cast (sdigits2->At(0)); + if(digit2 && digit2->GetType()==AliEMCALDigit::kEmbedded){ + embed = kTRUE; + } } } @@ -357,259 +345,258 @@ void AliEMCALDigitizer::Digitize(Int_t event) else AliFatal("EMCAL Loader of second event not available!"); } - else Fatal("Digitize", "Loader of second input not found"); - }// input loop + else Fatal("Digitize", "Loader of second input not found"); + }// input loop - //Find the first tower with signal - Int_t nextSig = nEMC + 1 ; - TClonesArray * sdigits ; - for(i = 0 ; i < fInput ; i++){ - if(i > 0 && embed) continue; - sdigits = dynamic_cast(sdigArray->At(i)) ; - if(sdigits){ - if (sdigits->GetEntriesFast() ){ - AliEMCALDigit *sd = dynamic_cast(sdigits->At(0)); - if(sd){ - Int_t curNext = sd->GetId() ; - if(curNext < nextSig) - nextSig = curNext ; - AliDebug(1,Form("input %i : #sdigits %i \n", - i, sdigits->GetEntriesFast())); + //Find the first tower with signal + Int_t nextSig = nEMC + 1 ; + TClonesArray * sdigits ; + for(i = 0 ; i < fInput ; i++){ + if(i > 0 && embed) continue; + sdigits = dynamic_cast(sdigArray->At(i)) ; + if(sdigits){ + if (sdigits->GetEntriesFast() ){ + AliEMCALDigit *sd = dynamic_cast(sdigits->At(0)); + if(sd){ + Int_t curNext = sd->GetId() ; + if(curNext < nextSig) + nextSig = curNext ; + AliDebug(1,Form("input %i : #sdigits %i \n", + i, sdigits->GetEntriesFast())); - }//First entry is not NULL - else { - Info("Digitize", "NULL sdigit pointer"); - continue; - } - }//There is at least one entry - else { - Info("Digitize", "NULL sdigits array"); - continue; - } - }// SDigits array exists - else { - Info("Digitizer","Null sdigit pointer"); - continue; - } - }// input loop - AliDebug(1,Form("FIRST tower with signal %i \n", nextSig)); + }//First entry is not NULL + else { + Info("Digitize", "NULL sdigit pointer"); + continue; + } + }//There is at least one entry + else { + Info("Digitize", "NULL sdigits array"); + continue; + } + }// SDigits array exists + else { + Info("Digitizer","Null sdigit pointer"); + continue; + } + }// input loop + AliDebug(1,Form("FIRST tower with signal %i \n", nextSig)); - TArrayI index(fInput) ; - index.Reset() ; //Set all indexes to zero + TArrayI index(fInput) ; + index.Reset() ; //Set all indexes to zero - AliEMCALDigit * digit ; - AliEMCALDigit * curSDigit ; + AliEMCALDigit * digit ; + AliEMCALDigit * curSDigit ; - //Put Noise contribution, smear time and energy - Float_t timeResolution = 0; - for(absID = 0; absID < nEMC; absID++){ // Nov 30, 2006 by PAI; was from 1 to nEMC - Float_t energy = 0 ; + //Put Noise contribution, smear time and energy + Float_t timeResolution = 0; + for(absID = 0; absID < nEMC; absID++){ // Nov 30, 2006 by PAI; was from 1 to nEMC + Float_t energy = 0 ; - // amplitude set to zero, noise will be added later - Float_t noiseTime = 0.; - if(!embed) noiseTime = TimeOfNoise(); //No need for embedded events? - new((*digits)[absID]) AliEMCALDigit( -1, -1, absID, 0., noiseTime,kFALSE); // absID-1->absID - //look if we have to add signal? - digit = dynamic_cast(digits->At(absID)); // absID-1->absID + // amplitude set to zero, noise will be added later + Float_t noiseTime = 0.; + if(!embed) noiseTime = TimeOfNoise(); //No need for embedded events? + new((*digits)[absID]) AliEMCALDigit( -1, -1, absID, 0., noiseTime,kFALSE); // absID-1->absID + //look if we have to add signal? + digit = dynamic_cast(digits->At(absID)); // absID-1->absID - if (digit) { + if (digit) { - if(absID==nextSig){ + if(absID==nextSig){ - // Calculate time as time of the largest digit - Float_t time = digit->GetTime() ; - Float_t aTime= digit->GetAmplitude() ; + // Calculate time as time of the largest digit + Float_t time = digit->GetTime() ; + Float_t aTime= digit->GetAmplitude() ; - // loop over input - Int_t nInputs = fInput; - if(embed) nInputs = 1; // In case of embedding, merge later real digits, do not smear energy and time of data - for(i = 0; i< nInputs ; i++){ //loop over (possible) merge sources - TClonesArray* sdtclarr = dynamic_cast(sdigArray->At(i)); - if(sdtclarr) { - Int_t sDigitEntries = sdtclarr->GetEntriesFast(); + // loop over input + Int_t nInputs = fInput; + if(embed) nInputs = 1; // In case of embedding, merge later real digits, do not smear energy and time of data + for(i = 0; i< nInputs ; i++){ //loop over (possible) merge sources + TClonesArray* sdtclarr = dynamic_cast(sdigArray->At(i)); + if(sdtclarr) { + Int_t sDigitEntries = sdtclarr->GetEntriesFast(); - if(sDigitEntries > index[i] ) - curSDigit = dynamic_cast(sdtclarr->At(index[i])) ; - else - curSDigit = 0 ; + if(sDigitEntries > index[i] ) + curSDigit = dynamic_cast(sdtclarr->At(index[i])) ; + else + curSDigit = 0 ; - //May be several digits will contribute from the same input - while(curSDigit && (curSDigit->GetId() == absID)){ - //Shift primary to separate primaries belonging different inputs - Int_t primaryoffset ; - if(fManager) - primaryoffset = fManager->GetMask(i) ; - else - primaryoffset = i ; - curSDigit->ShiftPrimary(primaryoffset) ; + //May be several digits will contribute from the same input + while(curSDigit && (curSDigit->GetId() == absID)){ + //Shift primary to separate primaries belonging different inputs + Int_t primaryoffset ; + if(fDigInput) + primaryoffset = fDigInput->GetMask(i) ; + else + primaryoffset = i ; + curSDigit->ShiftPrimary(primaryoffset) ; - if(curSDigit->GetAmplitude()>aTime) { - aTime = curSDigit->GetAmplitude(); - time = curSDigit->GetTime(); - } + if(curSDigit->GetAmplitude()>aTime) { + aTime = curSDigit->GetAmplitude(); + time = curSDigit->GetTime(); + } - *digit = *digit + *curSDigit ; //adds amplitudes of each digit + *digit = *digit + *curSDigit ; //adds amplitudes of each digit - index[i]++ ; + index[i]++ ; - if( sDigitEntries > index[i] ) - curSDigit = dynamic_cast(sdtclarr->At(index[i])) ; - else - curSDigit = 0 ; - }// while - }// source exists - }// loop over merging sources + if( sDigitEntries > index[i] ) + curSDigit = dynamic_cast(sdtclarr->At(index[i])) ; + else + curSDigit = 0 ; + }// while + }// source exists + }// loop over merging sources - //Here we convert the summed amplitude to an energy in GeV only for simulation or mixing of simulations - energy = sDigitizer->Calibrate(digit->GetAmplitude()) ; // GeV + //Here we convert the summed amplitude to an energy in GeV only for simulation or mixing of simulations + energy = fSDigitizer->Calibrate(digit->GetAmplitude()) ; // GeV - // add fluctuations for photo-electron creation - energy *= static_cast(gRandom->Poisson(fMeanPhotonElectron)) / static_cast(fMeanPhotonElectron) ; + // add fluctuations for photo-electron creation + energy *= static_cast(gRandom->Poisson(fMeanPhotonElectron)) / static_cast(fMeanPhotonElectron) ; - //calculate and set time - digit->SetTime(time) ; + //calculate and set time + digit->SetTime(time) ; - //Find next signal module - nextSig = nEMC + 1 ; - for(i = 0 ; i < nInputs ; i++){ - sdigits = dynamic_cast(sdigArray->At(i)) ; + //Find next signal module + nextSig = nEMC + 1 ; + for(i = 0 ; i < nInputs ; i++){ + sdigits = dynamic_cast(sdigArray->At(i)) ; - if(sdigits){ - Int_t curNext = nextSig ; - if(sdigits->GetEntriesFast() > index[i]) + if(sdigits){ + Int_t curNext = nextSig ; + if(sdigits->GetEntriesFast() > index[i]) { AliEMCALDigit * tmpdigit = dynamic_cast(sdigits->At(index[i])); if(tmpdigit) - { - curNext = tmpdigit->GetId() ; - } + { + curNext = tmpdigit->GetId() ; + } } - if(curNext < nextSig) nextSig = curNext ; - }// sdigits exist - } // input loop + if(curNext < nextSig) nextSig = curNext ; + }// sdigits exist + } // input loop - }//absID==nextSig + }//absID==nextSig - // add the noise now, no need for embedded events with real data - if(!embed) - energy += TMath::Abs(gRandom->Gaus(0., fPinNoise)) ; + // add the noise now, no need for embedded events with real data + if(!embed) + energy += TMath::Abs(gRandom->Gaus(0., fPinNoise)) ; - // JLK 26-June-2008 - //Now digitize the energy according to the sDigitizer method, - //which merely converts the energy to an integer. Later we will - //check that the stored value matches our allowed dynamic ranges - digit->SetAmplitude(sDigitizer->Digitize(energy)) ; + // JLK 26-June-2008 + //Now digitize the energy according to the fSDigitizer method, + //which merely converts the energy to an integer. Later we will + //check that the stored value matches our allowed dynamic ranges + digit->SetAmplitude(fSDigitizer->Digitize(energy)) ; - //Set time resolution with final energy - timeResolution = GetTimeResolution(energy); - digit->SetTime(gRandom->Gaus(digit->GetTime(),timeResolution) ) ; - AliDebug(10,Form(" absID %5i energy %f nextSig %5i\n", - absID, energy, nextSig)); - //Add delay to time - digit->SetTime(digit->GetTime()+fTimeDelay) ; + //Set time resolution with final energy + timeResolution = GetTimeResolution(energy); + digit->SetTime(gRandom->Gaus(digit->GetTime(),timeResolution) ) ; + AliDebug(10,Form(" absID %5i energy %f nextSig %5i\n", + absID, energy, nextSig)); + //Add delay to time + digit->SetTime(digit->GetTime()+fTimeDelay) ; - }// Digit pointer exists - else{ - Info("Digitizer","Digit pointer is null"); - } - } // for(absID = 0; absID < nEMC; absID++) + }// Digit pointer exists + else{ + Info("Digitizer","Digit pointer is null"); + } + } // for(absID = 0; absID < nEMC; absID++) //ticks->Delete() ; //delete ticks ; //Embed simulated amplitude (and time?) to real data digits - if(embed){ - for(Int_t input = 1; input (sdigArray->At(input)); - if(!realDigits){ - AliDebug(1,"No sdigits to merge\n"); - continue; - } - for(Int_t i2 = 0 ; i2 < realDigits->GetEntriesFast() ; i2++){ - AliEMCALDigit * digit2 = dynamic_cast( realDigits->At(i2) ) ; - if(digit2){ - digit = dynamic_cast( digits->At(digit2->GetId()) ) ; - if(digit){ + if(embed){ + for(Int_t input = 1; input (sdigArray->At(input)); + if(!realDigits){ + AliDebug(1,"No sdigits to merge\n"); + continue; + } + for(Int_t i2 = 0 ; i2 < realDigits->GetEntriesFast() ; i2++){ + AliEMCALDigit * digit2 = dynamic_cast( realDigits->At(i2) ) ; + if(digit2){ + digit = dynamic_cast( digits->At(digit2->GetId()) ) ; + if(digit){ - // Put the embedded cell energy in same units as simulated sdigits -> transform to energy units - // and multiply to get a big int. - Float_t time2 = digit2->GetTime(); - Float_t e2 = digit2->GetAmplitude(); - CalibrateADCTime(e2,time2,digit2->GetId()); - Float_t amp2 = sDigitizer->Digitize(e2); + // Put the embedded cell energy in same units as simulated sdigits -> transform to energy units + // and multiply to get a big int. + Float_t time2 = digit2->GetTime(); + Float_t e2 = digit2->GetAmplitude(); + CalibrateADCTime(e2,time2,digit2->GetId()); + Float_t amp2 = fSDigitizer->Digitize(e2); - Float_t e0 = digit ->GetAmplitude(); - if(e0>0.01) - AliDebug(1,Form("digit 1: Abs ID %d, amp %f, type %d, time %e; digit2: Abs ID %d, amp %f, type %d, time %e\n", - digit ->GetId(),digit ->GetAmplitude(), digit ->GetType(), digit->GetTime(), - digit2->GetId(),amp2, digit2->GetType(), time2 )); + Float_t e0 = digit ->GetAmplitude(); + if(e0>0.01) + AliDebug(1,Form("digit 1: Abs ID %d, amp %f, type %d, time %e; digit2: Abs ID %d, amp %f, type %d, time %e\n", + digit ->GetId(),digit ->GetAmplitude(), digit ->GetType(), digit->GetTime(), + digit2->GetId(),amp2, digit2->GetType(), time2 )); - // Sum amplitudes, change digit amplitude - digit->SetAmplitude( digit->GetAmplitude() + amp2); - // Rough assumption, assign time of the largest of the 2 digits, - // data or signal to the final digit. - if(amp2 > digit->GetAmplitude()) digit->SetTime(time2); - //Mark the new digit as embedded - digit->SetType(AliEMCALDigit::kEmbedded); + // Sum amplitudes, change digit amplitude + digit->SetAmplitude( digit->GetAmplitude() + amp2); + // Rough assumption, assign time of the largest of the 2 digits, + // data or signal to the final digit. + if(amp2 > digit->GetAmplitude()) digit->SetTime(time2); + //Mark the new digit as embedded + digit->SetType(AliEMCALDigit::kEmbedded); - if(digit2->GetAmplitude()>0.01 && e0> 0.01 ) - AliDebug(1,Form("Embedded digit: Abs ID %d, amp %f, type %d\n", - digit->GetId(), digit->GetAmplitude(), digit->GetType())); - }//digit2 - }//digit2 - }//loop digit 2 - }//input loop - }//embed + if(digit2->GetAmplitude()>0.01 && e0> 0.01 ) + AliDebug(1,Form("Embedded digit: Abs ID %d, amp %f, type %d\n", + digit->GetId(), digit->GetAmplitude(), digit->GetType())); + }//digit2 + }//digit2 + }//loop digit 2 + }//input loop + }//embed - //JLK is it better to call Clear() here? - delete sdigArray ; //We should not delete its contents + //JLK is it better to call Clear() here? + delete sdigArray ; //We should not delete its contents - //remove digits below thresholds - // until 10-02-2010 remove digits with energy smaller than fDigitThreshold 3*fPinNoise - // now, remove digits with Digitized ADC smaller than fDigitThreshold = 3, - // before merge in the same loop real data digits if available - Float_t energy = 0; - Float_t time = 0; - for(i = 0 ; i < nEMC ; i++){ - digit = dynamic_cast( digits->At(i) ) ; - if(digit){ + //remove digits below thresholds + // until 10-02-2010 remove digits with energy smaller than fDigitThreshold 3*fPinNoise + // now, remove digits with Digitized ADC smaller than fDigitThreshold = 3, + // before merge in the same loop real data digits if available + Float_t energy = 0; + Float_t time = 0; + for(i = 0 ; i < nEMC ; i++){ + digit = dynamic_cast( digits->At(i) ) ; + if(digit){ - //Then get the energy in GeV units. - energy = sDigitizer->Calibrate(digit->GetAmplitude()) ; - //Then digitize using the calibration constants of the ocdb - Float_t ampADC = energy; - DigitizeEnergyTime(ampADC, time, digit->GetId()) ; - if(ampADC < fDigitThreshold) - digits->RemoveAt(i) ; + //Then get the energy in GeV units. + energy = fSDigitizer->Calibrate(digit->GetAmplitude()) ; + //Then digitize using the calibration constants of the ocdb + Float_t ampADC = energy; + DigitizeEnergyTime(ampADC, time, digit->GetId()) ; + if(ampADC < fDigitThreshold) + digits->RemoveAt(i) ; - }// digit exists - } // digit loop + }// digit exists + } // digit loop - digits->Compress() ; + digits->Compress() ; - Int_t ndigits = digits->GetEntriesFast() ; + Int_t ndigits = digits->GetEntriesFast() ; - //JLK 26-June-2008 - //After we have done the summing and digitizing to create the - //digits, now we want to calibrate the resulting amplitude to match - //the dynamic range of our real data. - for (i = 0 ; i < ndigits ; i++) { - digit = dynamic_cast( digits->At(i) ) ; - if(digit){ - digit->SetIndexInList(i) ; - energy = sDigitizer->Calibrate(digit->GetAmplitude()) ; - time = digit->GetTime(); - Float_t ampADC = energy; - DigitizeEnergyTime(ampADC, time, digit->GetId()); - digit->SetAmplitude(ampADC) ; - digit->SetTime(time); - // printf("digit amplitude set at end: i %d, amp %f\n",i,digit->GetAmplitude()); - }// digit exists - }//Digit loop + //JLK 26-June-2008 + //After we have done the summing and digitizing to create the + //digits, now we want to calibrate the resulting amplitude to match + //the dynamic range of our real data. + for (i = 0 ; i < ndigits ; i++) { + digit = dynamic_cast( digits->At(i) ) ; + if(digit){ + digit->SetIndexInList(i) ; + energy = fSDigitizer->Calibrate(digit->GetAmplitude()) ; + time = digit->GetTime(); + Float_t ampADC = energy; + DigitizeEnergyTime(ampADC, time, digit->GetId()); + digit->SetAmplitude(ampADC) ; + digit->SetTime(time); + // printf("digit amplitude set at end: i %d, amp %f\n",i,digit->GetAmplitude()); + }// digit exists + }//Digit loop - }//SDigitizer not null } else AliFatal("EMCALLoader is NULL!") ; @@ -704,7 +691,7 @@ void AliEMCALDigitizer::CalibrateADCTime(Float_t & adc, Float_t & time, const In //____________________________________________________________________________ -void AliEMCALDigitizer::Exec(Option_t *option) +void AliEMCALDigitizer::Digitize(Option_t *option) { // Steering method to process digitization for events // in the range from fFirstEvent to fLastEvent. @@ -713,7 +700,7 @@ void AliEMCALDigitizer::Exec(Option_t *option) // by default fLastEvent = fFirstEvent (process only one event) if (!fInit) { // to prevent overwrite existing file - Error( "Exec", "Give a version name different from %s", fEventFolderName.Data() ) ; + Error( "Digitize", "Give a version name different from %s", fEventFolderName.Data() ) ; return ; } @@ -733,13 +720,11 @@ void AliEMCALDigitizer::Exec(Option_t *option) AliFatal("Did not get the Loader"); } else{ - // Post Digitizer to the white board - emcalLoader->PostDigitizer(this) ; if (fLastEvent == -1) { fLastEvent = rl->GetNumberOfEvents() - 1 ; } - else if (fManager) + else if (fDigInput) fLastEvent = fFirstEvent ; // what is this ?? nEvents = fLastEvent - fFirstEvent + 1; @@ -768,7 +753,6 @@ void AliEMCALDigitizer::Exec(Option_t *option) (emcalLoader->TreeD())->Fill(); emcalLoader->WriteDigits( "OVERWRITE"); - emcalLoader->WriteDigitizer("OVERWRITE"); Unload(); @@ -784,14 +768,12 @@ void AliEMCALDigitizer::Exec(Option_t *option) //increment the total number of Digits per run fDigitsInRun += emcalLoader->Digits()->GetEntriesFast() ; }//loop - - emcalLoader->CleanDigitizer() ; - + }//loader exists if(strstr(option,"tim")){ gBenchmark->Stop("EMCALDigitizer"); - AliInfo(Form("Exec: took %f seconds for Digitizing %f seconds per event", + AliInfo(Form("Digitize: took %f seconds for Digitizing %f seconds per event", gBenchmark->GetCpuTime("EMCALDigitizer"), gBenchmark->GetCpuTime("EMCALDigitizer")/nEvents )) ; } } @@ -946,8 +928,8 @@ Bool_t AliEMCALDigitizer::Init() fFirstEvent = 0 ; fLastEvent = fFirstEvent ; - if(fManager) - fInput = fManager->GetNinputs() ; + if(fDigInput) + fInput = fDigInput->GetNinputs() ; else fInput = 1 ; @@ -957,14 +939,11 @@ Bool_t AliEMCALDigitizer::Init() fEventNames[0] = fEventFolderName.Data() ; Int_t index ; for (index = 1 ; index < fInput ; index++) { - fInputFileNames[index] = dynamic_cast(fManager->GetInputStream(index))->GetFileName(0); - TString tempo = fManager->GetInputFolderName(index) ; - fEventNames[index] = tempo.Remove(tempo.Length()-1) ; // strip of the stream number added bt fManager + fInputFileNames[index] = dynamic_cast(fDigInput->GetInputStream(index))->GetFileName(0); + TString tempo = fDigInput->GetInputFolderName(index) ; + fEventNames[index] = tempo.Remove(tempo.Length()-1) ; // strip of the stream number added bt fDigInput } - - //to prevent cleaning of this object while GetEvent is called - emcalLoader->GetDigitsDataLoader()->GetBaseTaskLoader()->SetDoNotReload(kTRUE); - + //Calibration instance fCalibData = emcalLoader->CalibData(); return fInit ; @@ -1027,7 +1006,7 @@ void AliEMCALDigitizer::Print (Option_t * ) const printf(" Writing Digits to branch with title %s\n", fEventFolderName.Data()) ; Int_t nStreams ; - if (fManager) + if (fDigInput) nStreams = GetNInputStreams() ; else nStreams = fInput ; diff --git a/EMCAL/AliEMCALDigitizer.h b/EMCAL/AliEMCALDigitizer.h index 3284d0d712e..e4f6eb48d19 100644 --- a/EMCAL/AliEMCALDigitizer.h +++ b/EMCAL/AliEMCALDigitizer.h @@ -36,7 +36,7 @@ class TBrowser; #include "AliConfig.h" class AliEMCALCalibData ; class AliEMCALSDigitizer ; -class AliRunDigitizer ; +class AliDigitizationInput ; class AliEMCALDigitizer: public AliDigitizer { @@ -45,11 +45,11 @@ public: AliEMCALDigitizer(TString alirunFileNameFile, TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ; AliEMCALDigitizer(const AliEMCALDigitizer & dtizer) ; - AliEMCALDigitizer(AliRunDigitizer * manager) ; + AliEMCALDigitizer(AliDigitizationInput * manager) ; virtual ~AliEMCALDigitizer() ; void Digitize(Int_t event); // Make Digits from SDigits stored in fSDigits - void Exec(Option_t *option); // Supervising method + void Digitize(Option_t *option); // Supervising method Int_t GetDigitThreshold() const { return fDigitThreshold ; } Float_t GetPinNoise() const { return fPinNoise ; } @@ -124,8 +124,8 @@ private: Int_t fLastEvent; // last event to process AliEMCALCalibData * fCalibData; //Calibration data pointer - - ClassDef(AliEMCALDigitizer,11) // description + AliEMCALSDigitizer* fSDigitizer; // SDigitization object + ClassDef(AliEMCALDigitizer,12) // description }; diff --git a/EMCAL/AliEMCALLoader.h b/EMCAL/AliEMCALLoader.h index 2c98a04fd9f..0ed29b8006f 100644 --- a/EMCAL/AliEMCALLoader.h +++ b/EMCAL/AliEMCALLoader.h @@ -23,7 +23,6 @@ #include "TTree.h" class TString ; class TParticle ; -class TTask ; // --- AliRoot header files --- #include "AliLoader.h" diff --git a/EMCAL/AliEMCALPID.h b/EMCAL/AliEMCALPID.h index d984c4d46ae..80455b36f88 100644 --- a/EMCAL/AliEMCALPID.h +++ b/EMCAL/AliEMCALPID.h @@ -9,7 +9,6 @@ /////////////////////////////////////////////////////////////////////////////// //Root includes -#include "TTask.h" class TArrayD ; //AliRoot includes diff --git a/EMCAL/AliEMCALPIDUtils.h b/EMCAL/AliEMCALPIDUtils.h index c45ef713f76..d2b648c8b85 100644 --- a/EMCAL/AliEMCALPIDUtils.h +++ b/EMCAL/AliEMCALPIDUtils.h @@ -9,13 +9,13 @@ /////////////////////////////////////////////////////////////////////////////// //Root includes -#include "TTask.h" +#include "TNamed.h" class TArrayD ; //AliRoot includes #include "AliPID.h" -class AliEMCALPIDUtils : public TTask { +class AliEMCALPIDUtils : public TNamed { public: @@ -76,7 +76,7 @@ protected: Double_t fWeightGammaEnergy; // Weight for a Gamma to have a given energy (for the moment =1.) Double_t fWeightPiZeroEnergy; // Weight for a Pi0 Hadron to have a given energy (for the moment =1.) - ClassDef(AliEMCALPIDUtils, 1) + ClassDef(AliEMCALPIDUtils, 2) }; diff --git a/EMCAL/AliEMCALSDigitizer.cxx b/EMCAL/AliEMCALSDigitizer.cxx index bb6757bca5d..75aad405fe9 100644 --- a/EMCAL/AliEMCALSDigitizer.cxx +++ b/EMCAL/AliEMCALSDigitizer.cxx @@ -16,7 +16,7 @@ /* $Id$ */ //_________________________________________________________________________ -// This is a TTask that makes SDigits out of Hits +// This is a Class that makes SDigits out of Hits // A Summable Digits is the sum of all hits originating // from one in one tower of the EMCAL // A threshold for assignment of the primary to SDigit is applied @@ -36,13 +36,13 @@ // User case: // root [0] AliEMCALSDigitizer * s = new AliEMCALSDigitizer("galice.root") // Warning in : object already instantiated -// root [1] s->ExecuteTask() +// root [1] s->Digitize() // // Makes SDigitis for all events stored in galice.root // root [2] s->SetPedestalParameter(0.001) // // One can change parameters of digitization // root [3] s->SetSDigitsBranch("Redestal 0.001") // // and write them into the new branch -// root [4] s->ExeciteTask("deb all tim") +// root [4] s->Digitize("deb all tim") // // available parameters: // deb - print # of produced SDigitis // deb all - print # and list of produced SDigits @@ -77,7 +77,7 @@ ClassImp(AliEMCALSDigitizer) //____________________________________________________________________________ AliEMCALSDigitizer::AliEMCALSDigitizer() - : TTask("",""), + : TNamed("",""), fA(0.),fB(0.),fECPrimThreshold(0.), fDefaultInit(kTRUE), fEventFolderName(0), @@ -95,7 +95,7 @@ AliEMCALSDigitizer::AliEMCALSDigitizer() //____________________________________________________________________________ AliEMCALSDigitizer::AliEMCALSDigitizer(const char * alirunFileName, const char * eventFolderName) - : TTask("EMCAL"+AliConfig::Instance()->GetSDigitizerTaskName(), alirunFileName), + : TNamed("EMCALSDigitizer", alirunFileName), fA(0.),fB(0.),fECPrimThreshold(0.), fDefaultInit(kFALSE), fEventFolderName(eventFolderName), @@ -115,7 +115,7 @@ AliEMCALSDigitizer::AliEMCALSDigitizer(const char * alirunFileName, //____________________________________________________________________________ AliEMCALSDigitizer::AliEMCALSDigitizer(const AliEMCALSDigitizer & sd) - : TTask(sd.GetName(),sd.GetTitle()), + : TNamed(sd.GetName(),sd.GetTitle()), fA(sd.fA), fB(sd.fB), fECPrimThreshold(sd.fECPrimThreshold), @@ -135,9 +135,6 @@ AliEMCALSDigitizer::AliEMCALSDigitizer(const AliEMCALSDigitizer & sd) //____________________________________________________________________________ AliEMCALSDigitizer::~AliEMCALSDigitizer() { //dtor - AliLoader *emcalLoader=0; - if ((emcalLoader = AliRunLoader::Instance()->GetDetectorLoader("EMCAL"))) - emcalLoader->CleanSDigitizer(); if(fHits){ fHits->Clear(); @@ -147,8 +144,7 @@ AliEMCALSDigitizer::~AliEMCALSDigitizer() { //____________________________________________________________________________ void AliEMCALSDigitizer::Init(){ - // Initialization: open root-file, allocate arrays for hits and sdigits, - // attach task SDigitizer to the list of EMCAL tasks + // Initialization: open root-file, allocate arrays for hits and sdigits // // Initialization can not be done in the default constructor //============================================================= YS @@ -163,9 +159,6 @@ void AliEMCALSDigitizer::Init(){ return ; } - emcalLoader->PostSDigitizer(this); - emcalLoader->GetSDigitsDataLoader()->GetBaseTaskLoader()->SetDoNotReload(kTRUE); - } //____________________________________________________________________________ @@ -220,7 +213,7 @@ void AliEMCALSDigitizer::InitParameters() } //____________________________________________________________________________ -void AliEMCALSDigitizer::Exec(Option_t *option) +void AliEMCALSDigitizer::Digitize(Option_t *option) { // Collects all hit of the same tower into digits TString o(option); o.ToUpper(); @@ -247,11 +240,10 @@ void AliEMCALSDigitizer::Exec(Option_t *option) AliRunLoader *rl = AliRunLoader::Instance(); AliEMCALLoader *emcalLoader = dynamic_cast(rl->GetDetectorLoader("EMCAL")); - //switch off reloading of this task while getting event if (!fInit) { // to prevent overwrite existing file - AliError( Form("Give a version name different from %s", fEventFolderName.Data()) ) ; - return ; - } + AliError( Form("Give a version name different from %s", fEventFolderName.Data()) ) ; + return ; + } if (fLastEvent == -1) fLastEvent = rl->GetNumberOfEvents() - 1 ; @@ -317,7 +309,7 @@ void AliEMCALSDigitizer::Exec(Option_t *option) Digitize(energy), hit->GetTime(),kFALSE, -1, 0,0,energy ) ; } else { - Warning("Exec"," abs id %i is bad \n", hit->GetId()); + Warning("Digitize"," abs id %i is bad \n", hit->GetId()); newsdigit = kFALSE; curSDigit = 0; } @@ -380,19 +372,17 @@ void AliEMCALSDigitizer::Exec(Option_t *option) emcalLoader->WriteSDigits("OVERWRITE"); //NEXT - SDigitizer - emcalLoader->WriteSDigitizer("OVERWRITE"); // why in event cycle ? + //emcalLoader->WriteSDigitizer("OVERWRITE"); // why in event cycle ? if(strstr(option,"deb")) PrintSDigits(option) ; } Unload(); - - emcalLoader->GetSDigitsDataLoader()->GetBaseTaskLoader()->SetDoNotReload(kTRUE); - + if(strstr(option,"tim")){ gBenchmark->Stop("EMCALSDigitizer"); - printf("\n Exec: took %f seconds for SDigitizing %f seconds per event\n", + printf("\n Digitize: took %f seconds for SDigitizing %f seconds per event\n", gBenchmark->GetCpuTime("EMCALSDigitizer"), gBenchmark->GetCpuTime("EMCALSDigitizer")/nEvents ) ; } } @@ -533,5 +523,5 @@ void AliEMCALSDigitizer::Unload() const //____________________________________________________________________________ void AliEMCALSDigitizer::Browse(TBrowser* b) { - TTask::Browse(b); + TNamed::Browse(b); } diff --git a/EMCAL/AliEMCALSDigitizer.h b/EMCAL/AliEMCALSDigitizer.h index 9c88d82078e..a228f3e1a23 100644 --- a/EMCAL/AliEMCALSDigitizer.h +++ b/EMCAL/AliEMCALSDigitizer.h @@ -4,7 +4,7 @@ * See cxx source for full Copyright notice */ /* $Id$ */ //_________________________________________________________________________ -// This is a TTask that makes SDigits out of Hits +// This is a class that makes SDigits out of Hits // A Summable Digits is the sum of all hits originating // from one in one tower of the EMCAL // A threshold for assignment of the primary to SDigit is applied @@ -20,7 +20,7 @@ //_________________________________________________________________________ // --- ROOT system --- -#include "TTask.h" +#include "TNamed.h" class TBrowser; // --- Standard library --- @@ -28,7 +28,7 @@ class TBrowser; // --- AliRoot header files --- #include "AliConfig.h" -class AliEMCALSDigitizer: public TTask { +class AliEMCALSDigitizer: public TNamed { public: AliEMCALSDigitizer() ; // ctor @@ -39,7 +39,7 @@ public: Float_t Digitize(Float_t energy)const; //convert energy in GeV to int amplitude Float_t Calibrate(Float_t amp)const; //opposite of Digitize() - virtual void Exec(Option_t *option); + virtual void Digitize(Option_t *option=""); Int_t GetSDigitsInRun() const {return fSDigitsInRun ;} virtual void Print(Option_t *option="") const; void Print1(Option_t *option="all"); // *MENU* @@ -61,7 +61,7 @@ private: Float_t fA ; // Pedestal parameter Float_t fB ; // Slope Digitizition parameters Float_t fECPrimThreshold ; // To store primary if EC Shower Elos > threshold - Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized) + Bool_t fDefaultInit; //! Says if the object was created by defaut ctor (only parameters are initialized) TString fEventFolderName; // event folder name Bool_t fInit ; //! tells if initialisation went OK, will revent exec if not Int_t fSDigitsInRun ; //! Total number of sdigits in one run @@ -70,7 +70,7 @@ private: Float_t fSampling; // See AliEMCALGeometry TClonesArray* fHits; //-> Temporal array with hits - ClassDef(AliEMCALSDigitizer,7) // description + ClassDef(AliEMCALSDigitizer,8) // description }; #endif // AliEMCALSDIGITIZER_H diff --git a/FMD/AliFMD.cxx b/FMD/AliFMD.cxx index 0e35d5f753d..cd22e9b03a5 100644 --- a/FMD/AliFMD.cxx +++ b/FMD/AliFMD.cxx @@ -94,7 +94,7 @@ #include // ROOT_TVirtualMC #include // __CMATH__ -#include // ALIRUNDIGITIZER_H +#include // ALIRUNDIGITIZER_H #include // ALILOADER_H #include // ALIRUN_H #include // ALIMC_H @@ -943,7 +943,7 @@ AliFMD::Hits2Digits() // AliFMDHitDigitizer digitizer(this, AliFMDHitDigitizer::kDigits); digitizer.Init(); - digitizer.Exec(""); + digitizer.Digitize(""); } //____________________________________________________________________ @@ -955,13 +955,13 @@ AliFMD::Hits2SDigits() // AliFMDHitDigitizer digitizer(this, AliFMDHitDigitizer::kSDigits); digitizer.Init(); - digitizer.Exec(""); + digitizer.Digitize(""); } //____________________________________________________________________ AliDigitizer* -AliFMD::CreateDigitizer(AliRunDigitizer* manager) const +AliFMD::CreateDigitizer(AliDigitizationInput* digInput) const { // Create a digitizer object @@ -969,14 +969,14 @@ AliFMD::CreateDigitizer(AliRunDigitizer* manager) const AliFMDBaseDigitizer* digitizer = 0; #ifdef USE_SSDIGITIZER - digitizer = new AliFMDSSDigitizer(manager); + digitizer = new AliFMDSSDigitizer(digInput); #else /* This is what we actually do, and will work */ #if 0 AliInfo("SDigit->Digit conversion not really supported, " "doing Hit->Digit conversion instead"); #endif - digitizer = new AliFMDDigitizer(manager); + digitizer = new AliFMDDigitizer(digInput); #endif return digitizer; } diff --git a/FMD/AliFMD.h b/FMD/AliFMD.h index 9ba0853dac8..5f4491b7d6a 100644 --- a/FMD/AliFMD.h +++ b/FMD/AliFMD.h @@ -156,8 +156,8 @@ hits, digits, reconstructed points and ESD data. - AliFMDCalibFaker, AliFMDAlignFaker: Classes to write fake (or - dummy) calibration and alignment data. These derive from - TTask. + dummy) calibration and alignment data. + @section script Scripts @@ -542,7 +542,7 @@ public: /** Create a digitizer object @param manager Digitization manager @return a newly allocated AliFMDDigitizer */ - virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; + virtual AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const; /** Create AliFMDDigit's from AliFMDHit's. This is done by creating an AliFMDDigitizer object, and executing it. */ virtual void Hits2Digits(); diff --git a/FMD/AliFMDBaseDigitizer.cxx b/FMD/AliFMDBaseDigitizer.cxx index 9ae092cbb89..a689e00b0b5 100644 --- a/FMD/AliFMDBaseDigitizer.cxx +++ b/FMD/AliFMDBaseDigitizer.cxx @@ -209,7 +209,7 @@ #include "AliFMDHit.h" // ALIFMDHIT_H // #include "AliFMDDigit.h" // ALIFMDDIGIT_H #include "AliFMDParameters.h" // ALIFMDPARAMETERS_H -// #include // ALIRUNDIGITIZER_H +// #include // ALIRUNDIGITIZER_H //#include // ALIRUN_H #include // ALILOADER_H #include // ALILOADER_H @@ -239,8 +239,8 @@ AliFMDBaseDigitizer::AliFMDBaseDigitizer() } //____________________________________________________________________ -AliFMDBaseDigitizer::AliFMDBaseDigitizer(AliRunDigitizer* manager) - : AliDigitizer(manager, "AliFMDBaseDigitizer", "FMD Digitizer base class"), +AliFMDBaseDigitizer::AliFMDBaseDigitizer(AliDigitizationInput* digInput) + : AliDigitizer(digInput, "AliFMDBaseDigitizer", "FMD Digitizer base class"), fFMD(0), fRunLoader(0), fEdep(0), // nDet==0 means 51200 slots diff --git a/FMD/AliFMDBaseDigitizer.h b/FMD/AliFMDBaseDigitizer.h index bb135f494d1..0c9e85da50e 100644 --- a/FMD/AliFMDBaseDigitizer.h +++ b/FMD/AliFMDBaseDigitizer.h @@ -32,7 +32,7 @@ # include #endif #ifndef ALIRUNDIGITIZER_H -# include +# include #endif #ifndef ALIFMDEdepMAP_H # include "AliFMDEdepMap.h" @@ -160,7 +160,7 @@ public: AliFMDBaseDigitizer(); /** Normal CTOR @param manager Manager of digitization */ - AliFMDBaseDigitizer(AliRunDigitizer * manager); + AliFMDBaseDigitizer(AliDigitizationInput * digInp); /** Normal ctor @param name Name @param title Title */ @@ -278,7 +278,7 @@ protected: */ AliFMDBaseDigitizer& operator=(const AliFMDBaseDigitizer& o); - ClassDef(AliFMDBaseDigitizer,4) // Base class for FMD digitizers + ClassDef(AliFMDBaseDigitizer,5) // Base class for FMD digitizers }; diff --git a/FMD/AliFMDDigitizer.cxx b/FMD/AliFMDDigitizer.cxx index 5eabe0bda0f..69d42dc9a18 100644 --- a/FMD/AliFMDDigitizer.cxx +++ b/FMD/AliFMDDigitizer.cxx @@ -211,7 +211,7 @@ #include "AliFMDSDigit.h" // ALIFMDDIGIT_H #include "AliFMDDigit.h" // ALIFMDDIGIT_H #include "AliFMDParameters.h" // ALIFMDPARAMETERS_H -#include // ALIRUNDIGITIZER_H +#include // ALIRUNDIGITIZER_H #include // ALIRUN_H #include // ALILOADER_H #include // ALIRUNLOADER_H @@ -256,18 +256,18 @@ AliFMDDigitizer::Init() //____________________________________________________________________ void -AliFMDDigitizer::Exec(Option_t*) +AliFMDDigitizer::Digitize(Option_t*) { // // Execute this digitizer. // This member function will be called once per event by the passed - // AliRunDigitizer manager object. + // AliDigitizationInput* digInput object. // // Parameters: // options Not used // - if (!fManager) { - AliError("No digitisation manager defined"); + if (!fDigInput) { + AliError("No digitisation input defined"); return; } @@ -276,7 +276,7 @@ AliFMDDigitizer::Exec(Option_t*) AliRunLoader* runLoader = 0; if (!gAlice) { - TString folderName(fManager->GetInputFolderName(0)); + TString folderName(fDigInput->GetInputFolderName(0)); runLoader = AliRunLoader::GetRunLoader(folderName.Data()); if (!runLoader) { AliError(Form("Failed at getting run loader from %s", @@ -300,14 +300,14 @@ AliFMDDigitizer::Exec(Option_t*) // Loop over input files - Int_t nFiles= fManager->GetNinputs(); + Int_t nFiles= fDigInput->GetNinputs(); AliFMDDebug(1, (" Digitizing event number %d, got %d inputs", - fManager->GetOutputEventNr(), nFiles)); + fDigInput->GetOutputEventNr(), nFiles)); for (Int_t inputFile = 0; inputFile < nFiles; inputFile++) { AliFMDDebug(5, ("Now reading input # %d", inputFile)); // Get the current loader AliRunLoader* currentLoader = - AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inputFile)); + AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(inputFile)); if (!currentLoader) { Error("Exec", "no run loader for input file # %d", inputFile); continue; @@ -324,7 +324,7 @@ AliFMDDigitizer::Exec(Option_t*) // Get the tree of summable digits TTree* sdigitsTree = inFMD->TreeS(); if (!sdigitsTree) { - AliError("No sdigit tree from manager"); + AliError("No sdigit tree from input"); continue; } if (AliLog::GetDebugLevel("FMD","") >= 10) { @@ -359,7 +359,7 @@ AliFMDDigitizer::Exec(Option_t*) inFMD->UnloadSDigits(); } - TString outFolder(fManager->GetOutputFolderName()); + TString outFolder(fDigInput->GetOutputFolderName()); AliRunLoader* out = AliRunLoader::GetRunLoader(outFolder.Data()); AliLoader* outFMD = out->GetLoader("FMDLoader"); if (!outFMD) { diff --git a/FMD/AliFMDDigitizer.h b/FMD/AliFMDDigitizer.h index b51d4f7dfe0..08e972f2378 100644 --- a/FMD/AliFMDDigitizer.h +++ b/FMD/AliFMDDigitizer.h @@ -59,10 +59,10 @@ public: /** * CTOR * - * @param manager Manager of digitization + * @param input Input of digitization */ - AliFMDDigitizer(AliRunDigitizer * manager) - : AliFMDBaseDigitizer(manager) {} + AliFMDDigitizer(AliDigitizationInput * digInput) + : AliFMDBaseDigitizer(digInput) {} /** * DTOR */ @@ -74,11 +74,11 @@ public: /** * Execute this digitizer. * This member function will be called once per event by the passed - * AliRunDigitizer manager object. + * AliDigitizationInput* digInput object. * * @param options Not used */ - virtual void Exec(Option_t* option=""); + virtual void Digitize(Option_t* option=""); protected: /** * Sum contributions from SDigits diff --git a/FMD/AliFMDHitDigitizer.cxx b/FMD/AliFMDHitDigitizer.cxx index 3ccf75c3674..ad7d7f33459 100644 --- a/FMD/AliFMDHitDigitizer.cxx +++ b/FMD/AliFMDHitDigitizer.cxx @@ -240,7 +240,7 @@ AliFMDHitDigitizer::operator=(const AliFMDHitDigitizer& o) //____________________________________________________________________ void -AliFMDHitDigitizer::Exec(Option_t* /*option*/) +AliFMDHitDigitizer::Digitize(Option_t* /*option*/) { // Run this digitizer // Get an inititialize parameter manager diff --git a/FMD/AliFMDHitDigitizer.h b/FMD/AliFMDHitDigitizer.h index 7038e1315c4..828b3076a66 100644 --- a/FMD/AliFMDHitDigitizer.h +++ b/FMD/AliFMDHitDigitizer.h @@ -61,7 +61,7 @@ public: /** DTOR */ virtual ~AliFMDHitDigitizer() {} /** Run over the input events (retrieved via run loader) */ - void Exec(Option_t* option=""); + void Digitize(Option_t* option=""); /** * Set the end of integration * diff --git a/HMPID/AliHMPIDDigitizer.cxx b/HMPID/AliHMPIDDigitizer.cxx index 91a6d3012df..15b9fe02a70 100644 --- a/HMPID/AliHMPIDDigitizer.cxx +++ b/HMPID/AliHMPIDDigitizer.cxx @@ -19,7 +19,7 @@ //. #include #include -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include #include "AliLog.h" #include @@ -38,18 +38,18 @@ ClassImp(AliHMPIDDigitizer) Bool_t AliHMPIDDigitizer::fgDoNoise=kTRUE; //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -void AliHMPIDDigitizer::Exec(Option_t*) +void AliHMPIDDigitizer::Digitize(Option_t*) { // This methode is responsible for merging sdigits to a list of digits //Disintegration leeds to the fact that one hit affects several neighbouring pads, which means that the same pad might be affected by few hits. - AliDebug(1,Form("Start with %i input(s) for event %i",fManager->GetNinputs(),fManager->GetOutputEventNr())); + AliDebug(1,Form("Start with %i input(s) for event %i",fDigInput->GetNinputs(),fDigInput->GetOutputEventNr())); //First we read all sdigits from all inputs AliRunLoader *pInRunLoader=0;//in and out Run loaders AliLoader *pInRichLoader=0;//in and out HMPID loaders static TClonesArray sdigs("AliHMPIDDigit");//tmp storage for sdigits sum up from all input files Int_t total=0; - for(Int_t inFileN=0;inFileNGetNinputs();inFileN++){//files loop - pInRunLoader = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inFileN)); //get run loader from current input + for(Int_t inFileN=0;inFileNGetNinputs();inFileN++){//files loop + pInRunLoader = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(inFileN)); //get run loader from current input pInRichLoader = pInRunLoader->GetLoader("HMPIDLoader"); if(pInRichLoader==0) continue; //no HMPID in this input, check the next input if (!pInRunLoader->GetAliRun()) pInRunLoader->LoadgAlice(); AliHMPID* pInRich=(AliHMPID*)pInRunLoader->GetAliRun()->GetDetector("HMPID"); //take HMPID from current input @@ -57,7 +57,7 @@ void AliHMPIDDigitizer::Exec(Option_t*) AliDebug(1,Form("input %i has %i sdigits",inFileN,pInRich->SdiLst()->GetEntries())); for(Int_t i=0;iSdiLst()->GetEntries();i++){ //collect sdigits from current input AliHMPIDDigit *pSDig=(AliHMPIDDigit*)pInRich->SdiLst()->At(i); - pSDig->AddTidOffset(fManager->GetMask(inFileN)); //apply TID shift since all inputs count tracks independently starting from 0 + pSDig->AddTidOffset(fDigInput->GetMask(inFileN)); //apply TID shift since all inputs count tracks independently starting from 0 new(sdigs[total++]) AliHMPIDDigit(*pSDig); } pInRichLoader->UnloadSDigits(); pInRich->SdiReset(); //close current input and reset @@ -65,7 +65,7 @@ void AliHMPIDDigitizer::Exec(Option_t*) //PH if(sdigs.GetEntries()==0) return; //no sdigits collected, nothing to convert - AliRunLoader *pOutRunLoader = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); //open output stream (only 1 possible) + AliRunLoader *pOutRunLoader = AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName()); //open output stream (only 1 possible) AliLoader *pOutRichLoader = pOutRunLoader->GetLoader("HMPIDLoader"); //take output HMPID loader AliRun *pArun = pOutRunLoader->GetAliRun(); AliHMPID *pOutRich = (AliHMPID*)pArun->GetDetector("HMPID"); //take output HMPID diff --git a/HMPID/AliHMPIDDigitizer.h b/HMPID/AliHMPIDDigitizer.h index 68d54513cd0..e91bed9a4ae 100644 --- a/HMPID/AliHMPIDDigitizer.h +++ b/HMPID/AliHMPIDDigitizer.h @@ -11,13 +11,13 @@ class TClonesArray; class TObjArray; -class AliHMPIDDigitizer : public AliDigitizer //TObject-TNamed-TTask-AliDigitizer-AliHMPIDDigitizer +class AliHMPIDDigitizer : public AliDigitizer //TObject-TNamed-AliDigitizer-AliHMPIDDigitizer { public: AliHMPIDDigitizer() {} - AliHMPIDDigitizer(AliRunDigitizer *pRunDig):AliDigitizer(pRunDig) {} + AliHMPIDDigitizer(AliDigitizationInput *digInp):AliDigitizer(digInp) {} virtual ~AliHMPIDDigitizer() {} - void Exec(Option_t* option=0); //virtual + void Digitize(Option_t* option=0); //virtual void DoNoise(Bool_t doNoise) {fgDoNoise=doNoise;} // Set noise or not // static void Sdi2Dig(TClonesArray *pSDigLst,TObjArray *pDigLst); diff --git a/HMPID/AliHMPIDPid.cxx b/HMPID/AliHMPIDPid.cxx index bebe27e352e..e5d7a58d5d9 100644 --- a/HMPID/AliHMPIDPid.cxx +++ b/HMPID/AliHMPIDPid.cxx @@ -28,7 +28,7 @@ #include //Resolution() //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -AliHMPIDPid::AliHMPIDPid():TTask("HMPIDrec","HMPIDPid") +AliHMPIDPid::AliHMPIDPid():TNamed("HMPIDrec","HMPIDPid") { //.. //init of data members diff --git a/HMPID/AliHMPIDPid.h b/HMPID/AliHMPIDPid.h index 1dd2942f8d0..6ec3d89e846 100644 --- a/HMPID/AliHMPIDPid.h +++ b/HMPID/AliHMPIDPid.h @@ -12,12 +12,11 @@ // // ////////////////////////////////////////////////////////////////////////// - -#include //base class +#include class AliESDtrack; -class AliHMPIDPid : public TTask +class AliHMPIDPid : public TNamed { public : AliHMPIDPid(); //ctor diff --git a/HMPID/AliHMPIDRecon.cxx b/HMPID/AliHMPIDRecon.cxx index 72336d90cae..c364377055f 100644 --- a/HMPID/AliHMPIDRecon.cxx +++ b/HMPID/AliHMPIDRecon.cxx @@ -31,7 +31,7 @@ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ AliHMPIDRecon::AliHMPIDRecon(): - TTask("RichRec","RichPat"), + TNamed("RichRec","RichPat"), fPhotCnt(-1), fPhotFlag(0x0), fPhotClusIndex(0x0), diff --git a/HMPID/AliHMPIDRecon.h b/HMPID/AliHMPIDRecon.h index f5dd89aa24f..6a7b5ef5f19 100644 --- a/HMPID/AliHMPIDRecon.h +++ b/HMPID/AliHMPIDRecon.h @@ -13,14 +13,14 @@ ////////////////////////////////////////////////////////////////////////// -#include //base class +#include //base class #include //fields class TClonesArray; //CkovAngle() class AliESDtrack; //CkovAngle() class AliHMPIDParam;//general pourpose -class AliHMPIDRecon : public TTask +class AliHMPIDRecon : public TNamed { public : AliHMPIDRecon(); @@ -83,7 +83,7 @@ private: AliHMPIDRecon(const AliHMPIDRecon& r); //dummy copy constructor AliHMPIDRecon &operator=(const AliHMPIDRecon& r); //dummy assignment operator // - ClassDef(AliHMPIDRecon,2) + ClassDef(AliHMPIDRecon,3) }; #endif // #ifdef AliHMPIDRecon_cxx diff --git a/HMPID/AliHMPIDReconHTA.cxx b/HMPID/AliHMPIDReconHTA.cxx index 0048322c809..6ba7dc1b751 100644 --- a/HMPID/AliHMPIDReconHTA.cxx +++ b/HMPID/AliHMPIDReconHTA.cxx @@ -37,7 +37,7 @@ Int_t AliHMPIDReconHTA::fgDB[500][150]={{75000*0}}; //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ AliHMPIDReconHTA::AliHMPIDReconHTA(): - TTask("RichRec","RichPat"), + TNamed("RichRec","RichPat"), fMipX(-999), fMipY(-999), fMipQ(-999), diff --git a/HMPID/AliHMPIDReconHTA.h b/HMPID/AliHMPIDReconHTA.h index 4537fcd171e..a33af2e9243 100644 --- a/HMPID/AliHMPIDReconHTA.h +++ b/HMPID/AliHMPIDReconHTA.h @@ -13,13 +13,13 @@ ////////////////////////////////////////////////////////////////////////// -#include //base class +#include //base class class TClonesArray; //CkovAngle() class AliESDtrack; //CkovAngle() class AliHMPIDParam;//General pourpose -class AliHMPIDReconHTA : public TTask +class AliHMPIDReconHTA : public TNamed { public : AliHMPIDReconHTA(); @@ -103,7 +103,7 @@ private: AliHMPIDReconHTA(const AliHMPIDReconHTA& r); //dummy copy constructor AliHMPIDReconHTA &operator=(const AliHMPIDReconHTA& r); //dummy assignment operator // - ClassDef(AliHMPIDReconHTA,4) + ClassDef(AliHMPIDReconHTA,5) }; #endif // #ifdef AliHMPIDReconHTA_cxx diff --git a/HMPID/AliHMPIDv1.h b/HMPID/AliHMPIDv1.h index 018e9e4fe73..8b46450dc8f 100644 --- a/HMPID/AliHMPIDv1.h +++ b/HMPID/AliHMPIDv1.h @@ -21,7 +21,7 @@ public: void AddAlignableVolumes( )const; //from AliModule invoked from AliMC void CreateMaterials ( ); //from AliModule invoked from AliMC void CreateGeometry ( ); //from AliModule invoked from AliMC - AliDigitizer* CreateDigitizer (AliRunDigitizer *m )const{return new AliHMPIDDigitizer(m);} //from AliModule invoked from AliSimulation::RunDigitization() + AliDigitizer* CreateDigitizer (AliDigitizationInput *m )const{return new AliHMPIDDigitizer(m);} //from AliModule invoked from AliSimulation::RunDigitization() void Digits2Raw ( ); //from AliModule invoked from AliSimulation::WriteRawFiles() virtual void DefineOpticalProperties(); //from AliModule invoked from AliMC::ConstructOpGeometry() to set Cerenkov properties void Hits2SDigits ( ); //from AliModule invoked from AliSimulation::RunSDigitization() diff --git a/HMPID/AliHMPIDv2.h b/HMPID/AliHMPIDv2.h index 7bc61c49b7c..3b0968faac1 100644 --- a/HMPID/AliHMPIDv2.h +++ b/HMPID/AliHMPIDv2.h @@ -23,7 +23,7 @@ public: void CreateMaterials ( ); //from AliModule invoked from AliMC static void IdealPosition(Int_t iCh,TGeoHMatrix *m); //ideal position of a given chamber void CreateGeometry ( ); //from AliModule invoked from AliMC - AliDigitizer* CreateDigitizer (AliRunDigitizer *m )const{return new AliHMPIDDigitizer(m);} //from AliModule invoked from AliSimulation::RunDigitization() + AliDigitizer* CreateDigitizer (AliDigitizationInput *m )const{return new AliHMPIDDigitizer(m);} //from AliModule invoked from AliSimulation::RunDigitization() void Digits2Raw ( ); //from AliModule invoked from AliSimulation::WriteRawFiles() virtual void DefineOpticalProperties( ); //from AliModule invoked from AliMC::ConstructOpGeometry() to set Cerenkov properties //void InitProperties ( ); //define the phys processes on/off (dray,eloss...) diff --git a/HMPID/AliHMPIDv3.h b/HMPID/AliHMPIDv3.h index e1976a163e2..de3993d7519 100644 --- a/HMPID/AliHMPIDv3.h +++ b/HMPID/AliHMPIDv3.h @@ -28,7 +28,7 @@ public: static void IdealPosition(Int_t iCh,TGeoHMatrix *m); //ideal position of a given chamber static void IdealPositionCradle(Int_t iCh,TGeoHMatrix *m); //ideal position of a module of the cradle void CreateGeometry ( ); //from AliModule invoked from AliMC - AliDigitizer* CreateDigitizer (AliRunDigitizer *m )const{return new AliHMPIDDigitizer(m);} //from AliModule invoked from AliSimulation::RunDigitization() + AliDigitizer* CreateDigitizer (AliDigitizationInput *m )const{return new AliHMPIDDigitizer(m);} //from AliModule invoked from AliSimulation::RunDigitization() void Digits2Raw ( ); //from AliModule invoked from AliSimulation::WriteRawFiles() virtual void DefineOpticalProperties( ); //from AliModule invoked from AliMC::ConstructOpGeometry() to set Cerenkov properties // void InitProperties ( ); //define the phys processes on/off (dray,eloss...) diff --git a/ITS/AliITS.cxx b/ITS/AliITS.cxx index 78407b11d71..48d1709b99f 100644 --- a/ITS/AliITS.cxx +++ b/ITS/AliITS.cxx @@ -257,18 +257,18 @@ AliITS::~AliITS(){ } //______________________________________________________________________ -AliDigitizer* AliITS::CreateDigitizer(AliRunDigitizer* manager)const{ +AliDigitizer* AliITS::CreateDigitizer(AliDigitizationInput* digInput)const{ // Creates the AliITSDigitizer in a standard way for use via AliModule. // This function can not be included in the .h file because of problems // with the order of inclusion (recursive). // Inputs: - // AliRunDigitizer *manager The Manger class for Digitization + // AliDigitizationInput* digInput The Manger class for Digitization // Output: // none. // Return: // A new AliITSRunDigitizer (cast as a AliDigitizer). - return new AliITSDigitizer(manager); + return new AliITSDigitizer(digInput); } //______________________________________________________________________ void AliITS::Init(){ diff --git a/ITS/AliITS.h b/ITS/AliITS.h index 96990e45544..410ad2058c8 100644 --- a/ITS/AliITS.h +++ b/ITS/AliITS.h @@ -27,7 +27,7 @@ class AliITShit; class AliITSgeom; class AliITSdigit; class AliITSmodule; -class AliRunDigitizer; +class AliDigitizationInput; class TArrayI; class AliITS : public AliDetector { @@ -108,7 +108,7 @@ class AliITS : public AliDetector { // Trigger virtual AliTriggerDetector* CreateTriggerDetector() const; - AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; + AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const; virtual void UpdateInternalGeometry(); virtual void SDigitsToDigits(Option_t *opt="All"); virtual void SDigits2Digits(){SDigitsToDigits("All");} diff --git a/ITS/AliITSDigitizer.cxx b/ITS/AliITSDigitizer.cxx index 014f4a7fb8c..2b180269ef2 100644 --- a/ITS/AliITSDigitizer.cxx +++ b/ITS/AliITSDigitizer.cxx @@ -34,7 +34,7 @@ #include "AliRunLoader.h" #include "AliLoader.h" #include "AliLog.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliITSDigitizer.h" #include "AliITSgeom.h" #include "AliITSgeomTGeo.h" @@ -63,7 +63,7 @@ fFlagFirstEv(kTRUE){ } //______________________________________________________________________ -AliITSDigitizer::AliITSDigitizer(AliRunDigitizer *mngr) : AliDigitizer(mngr), +AliITSDigitizer::AliITSDigitizer(AliDigitizationInput* digInp) : AliDigitizer(digInp), fITS(0), fModActive(0), fInit(kFALSE), @@ -130,7 +130,7 @@ Bool_t AliITSDigitizer::Init(){ return fInit; } //______________________________________________________________________ -void AliITSDigitizer::Exec(Option_t* opt){ +void AliITSDigitizer::Digitize(Option_t* opt){ // Main digitization function. // Inputs: // Option_t * opt list of sub detector to digitize. =0 all. @@ -145,8 +145,8 @@ void AliITSDigitizer::Exec(Option_t* opt){ strstr(opt,"SSD")}; if( !det[0] && !det[1] && !det[2] ) all = "All"; else all = 0; - Int_t nfiles = GetManager()->GetNinputs(); - Int_t event = GetManager()->GetOutputEventNr(); + Int_t nfiles = GetDigInput()->GetNinputs(); + Int_t event = GetDigInput()->GetOutputEventNr(); AliITSsimulation *sim = 0; if(fFlagFirstEv){ fITS->SetDefaults(); @@ -181,7 +181,7 @@ void AliITSDigitizer::Exec(Option_t* opt){ AliRunLoader *inRL = 0x0, *outRL = 0x0; AliLoader *ingime = 0x0, *outgime = 0x0; - outRL = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); + outRL = AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName()); if ( outRL == 0x0) { Error("Exec","Can not get Output Run Loader"); @@ -212,7 +212,7 @@ void AliITSDigitizer::Exec(Option_t* opt){ for(ifiles=0; ifilesGetInputFolderName(fl[ifiles])); + inRL = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(fl[ifiles])); ingime = inRL->GetLoader(loadname); if (ingime->TreeS() == 0x0) ingime->LoadSDigits(); } @@ -234,7 +234,7 @@ void AliITSDigitizer::Exec(Option_t* opt){ { if(fRoif!=0) if(!fModActive[module]) continue; - inRL = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(fl[ifiles])); + inRL = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(fl[ifiles])); ingime = inRL->GetLoader(loadname); TTree *treeS = ingime->TreeS(); @@ -252,11 +252,11 @@ void AliITSDigitizer::Exec(Option_t* opt){ return; } // end if brchSDigits sdig->Clear(); - mask = GetManager()->GetMask(ifiles); + mask = GetDigInput()->GetMask(ifiles); // add summable digits to module brchSDigits->GetEvent( module ); lmod = sim->AddSDigitsToModule(sdig,mask); - if(fRegionOfInterest && (ifiles==0)) + if(GetRegionOfInterest() && (ifiles==0)) { fModActive[module] = lmod; } // end if @@ -275,7 +275,7 @@ void AliITSDigitizer::Exec(Option_t* opt){ outgime->UnloadDigits(); for(ifiles=0; ifilesGetInputFolderName(fl[ifiles])); + inRL = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(fl[ifiles])); ingime = inRL->GetLoader(loadname); ingime->UnloadSDigits(); } diff --git a/ITS/AliITSDigitizer.h b/ITS/AliITSDigitizer.h index 5bd87e6fcb4..b6c434d8a50 100644 --- a/ITS/AliITSDigitizer.h +++ b/ITS/AliITSDigitizer.h @@ -12,7 +12,7 @@ class TObjArray; class TTree; -class AliRunDigitizer; +class AliDigitizationInput; #include "AliDigitizer.h" // Base class from which this one is derived #include "AliITS.h" // ITS class functions used in inline functions. @@ -21,14 +21,14 @@ class AliITSmodule; class AliITSDigitizer : public AliDigitizer{ public: AliITSDigitizer(); - AliITSDigitizer(AliRunDigitizer *manager); + AliITSDigitizer(AliDigitizationInput* digInput); virtual ~AliITSDigitizer(); // Standard routines. virtual Bool_t Init(); // Perform SDigits to Digits, with or without merging, depending on the // number of files. - virtual void Exec(Option_t* opt=0); + virtual void Digitize(Option_t* opt=0); // Sets a particular module active virtual void SetModuleActive(Int_t i){if(fModActive) fModActive[i] = kTRUE;} // Sets a particular module inactive @@ -53,7 +53,7 @@ class AliITSDigitizer : public AliDigitizer{ // Returns a pointer to a specific module. AliITSmodule* GetModule(Int_t i){return fITS->GetModule(i);} // Returns a pointer to the manager - AliRunDigitizer* GetManager(){return fManager;} + AliDigitizationInput* GetDigInput(){return fDigInput;} // Sets the region of Interest based on which module have SDigits // Defined (non-noise SDigits). virtual void SetByRegionOfInterest(TTree *ts); diff --git a/ITS/AliITSreconstruction.h b/ITS/AliITSreconstruction.h index e61e718a181..d1e5dcb91c7 100644 --- a/ITS/AliITSreconstruction.h +++ b/ITS/AliITSreconstruction.h @@ -12,13 +12,13 @@ // // //////////////////////////////////////////////////////////////////////// -#include +#include class AliRunLoader; class AliITSLoader; class TString; -class AliITSreconstruction : public TTask{ +class AliITSreconstruction : public TNamed{ public: AliITSreconstruction(); // default constructor AliITSreconstruction(const char *filename); // standard constructor @@ -44,7 +44,7 @@ class AliITSreconstruction : public TTask{ AliITSLoader *fLoader; //! ITS loader AliRunLoader* fRunLoader;//!Run Loader - ClassDef(AliITSreconstruction,3) // Task to Reconstruct ITS from Digits. + ClassDef(AliITSreconstruction,4) // Class to Reconstruct ITS from Digits. }; #endif diff --git a/ITS/AliITSsDigitize.cxx b/ITS/AliITSsDigitize.cxx index 282b6aa618c..309eb860087 100644 --- a/ITS/AliITSsDigitize.cxx +++ b/ITS/AliITSsDigitize.cxx @@ -155,7 +155,7 @@ Bool_t AliITSsDigitize::InitSDig() const { } //______________________________________________________________________ -void AliITSsDigitize::Exec(const Option_t *opt){ +void AliITSsDigitize::Digitize(const Option_t *opt){ // Main SDigitization function. // Inputs: // Option_t * opt list of subdetector to digitize. =0 all. @@ -184,7 +184,7 @@ void AliITSsDigitize::Exec(const Option_t *opt){ } // end if strstr(opt,...) if(!fInit){ - cout << "Initilization Failed, Can't run Exec." << endl; + cout << "Initilization Failed, Can't run Digitize." << endl; return; } // end if !fInit diff --git a/ITS/AliITSsDigitize.h b/ITS/AliITSsDigitize.h index 09f1a60d697..75d77eda64e 100644 --- a/ITS/AliITSsDigitize.h +++ b/ITS/AliITSsDigitize.h @@ -12,18 +12,18 @@ // // ///////////////////////////////////////////////////////// -#include +#include class TString; class AliITS; -class AliITSsDigitize : public TTask{ +class AliITSsDigitize : public TNamed { public: AliITSsDigitize(); // default constructor AliITSsDigitize(const char *filename); // standard constructor virtual ~AliITSsDigitize();//Destructor virtual Bool_t Init(); - virtual void Exec(const Option_t *opt="ALL"); + virtual void Digitize(const Option_t *opt="ALL"); private: Bool_t InitSDig() const; // Standard SDigitization initilization. private: @@ -39,7 +39,7 @@ class AliITSsDigitize : public TTask{ Int_t fEnt0; //! first event to process, default 0. AliITS *fITS; //! Local pointer to ITS class. AliRunLoader* fRunLoader;//!Run Loader - ClassDef(AliITSsDigitize,1) // Task to SDigitize ITS from Hits. + ClassDef(AliITSsDigitize,2) // Class to SDigitize ITS from Hits. }; #endif diff --git a/ITS/UPGRADE/AliITSUpg.cxx b/ITS/UPGRADE/AliITSUpg.cxx index 98a33944f19..1325c7d56bb 100644 --- a/ITS/UPGRADE/AliITSUpg.cxx +++ b/ITS/UPGRADE/AliITSUpg.cxx @@ -255,12 +255,12 @@ AliITSUpg::~AliITSUpg(){ } //______________________________________________________________________ -AliDigitizer* AliITSUpg::CreateDigitizer(AliRunDigitizer* manager)const{ +AliDigitizer* AliITSUpg::CreateDigitizer(AliDigitizationInput* manager)const{ // Creates the AliITSDigitizer in a standard way for use via AliModule. // This function can not be included in the .h file because of problems // with the order of inclusion (recursive). // Inputs: - // AliRunDigitizer *manager The Manger class for Digitization + // AliDigitizationInput *manager The Manger class for Digitization // Output: // none. // Return: diff --git a/ITS/UPGRADE/AliITSUpg.h b/ITS/UPGRADE/AliITSUpg.h index aed02f1b10d..3e6dd39b0a6 100644 --- a/ITS/UPGRADE/AliITSUpg.h +++ b/ITS/UPGRADE/AliITSUpg.h @@ -27,7 +27,7 @@ class AliITShit; class AliITSgeom; class AliITSdigit; class AliITSmodule; -class AliRunDigitizer; +class AliDigitizationInput; class AliITSUpg : public AliDetector { @@ -107,7 +107,7 @@ class AliITSUpg : public AliDetector { // Trigger virtual AliTriggerDetector* CreateTriggerDetector() const; - AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; + AliDigitizer* CreateDigitizer(AliDigitizationInput* manager) const; virtual void UpdateInternalGeometry(); virtual void SDigitsToDigits(Option_t *opt="All"); virtual void SDigits2Digits(){SDigitsToDigits("All");} diff --git a/ITS/UPGRADE/AliITSupgrade.h b/ITS/UPGRADE/AliITSupgrade.h index 42359182f95..a9b36992b7b 100644 --- a/ITS/UPGRADE/AliITSupgrade.h +++ b/ITS/UPGRADE/AliITSupgrade.h @@ -72,7 +72,7 @@ class AliITSupgrade : public AliITS //TObject-TNamed-AliModule-AliDetector-AliIT for(Int_t i=0;iAddAt(new TClonesArray("AliITSDigitUpgrade"),i);}//create digits list void DigitsReset () {if(fDigitArray)for(int i=0;iAt(i)->Clear(); }//clean digits list - AliDigitizer* CreateDigitizer (AliRunDigitizer *m) const {return new AliITSupgradeDigitizer(m);} //from AliModule invoked from AliSimulation::RunDigitization() + AliDigitizer* CreateDigitizer (AliDigitizationInput *m) const {return new AliITSupgradeDigitizer(m);} //from AliModule invoked from AliSimulation::RunDigitization() void Hit2SumDig(TClonesArray *hits,const TObjArray *pSDig, Int_t *nSdigit); diff --git a/ITS/UPGRADE/AliITSupgradeDigitizer.cxx b/ITS/UPGRADE/AliITSupgradeDigitizer.cxx index 9bbd849192a..a32c540bbe2 100644 --- a/ITS/UPGRADE/AliITSupgradeDigitizer.cxx +++ b/ITS/UPGRADE/AliITSupgradeDigitizer.cxx @@ -18,7 +18,7 @@ #include #include -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include #include #include "AliITSupgradeDigitizer.h" @@ -53,13 +53,13 @@ ClassImp(AliITSupgradeDigitizer) } } //______________________________________________________________________________ -void AliITSupgradeDigitizer::Exec(Option_t*) +void AliITSupgradeDigitizer::Digitize(Option_t*) { // This method is responsible for merging sdigits to a list of digits // Disintegration leeds to the fact that one hit affects several neighbouring pads, // which means that the same pad might be affected by few hits. - AliDebug(1,Form("Start with %i input(s) for event %i",fManager->GetNinputs(),fManager->GetOutputEventNr())); + AliDebug(1,Form("Start with %i input(s) for event %i",fDigInput->GetNinputs(),fDigInput->GetOutputEventNr())); AliITSsegmentationUpgrade *s = new AliITSsegmentationUpgrade(); @@ -74,9 +74,9 @@ void AliITSupgradeDigitizer::Exec(Option_t*) Int_t total[10]={0,0,0,0,0,0,0,0,0,0}; - for(Int_t inFileN=0;inFileNGetNinputs();inFileN++){//files loop + for(Int_t inFileN=0;inFileNGetNinputs();inFileN++){//files loop - pInRunLoader = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inFileN)); //get run loader from current input + pInRunLoader = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(inFileN)); //get run loader from current input pITSLoader = pInRunLoader->GetLoader("ITSLoader"); if(pITSLoader==0) { continue; //no ITS in this input, check the next input @@ -95,7 +95,7 @@ void AliITSupgradeDigitizer::Exec(Option_t*) //collect sdigits from current input for(Int_t ientr =0; ientr < ((TClonesArray*)pITS->SDigitsList()->At(is))->GetEntries(); ientr++){ AliITSDigitUpgrade *pSDig=(AliITSDigitUpgrade*)((TClonesArray*)pITS->SDigitsList()->At(is))->At(ientr); - pSDig->AddTidOffset(fManager->GetMask(inFileN)); // -> To be introduced for merging (apply TID shift since all inputs count tracks independently starting from 0) + pSDig->AddTidOffset(fDigInput->GetMask(inFileN)); // -> To be introduced for merging (apply TID shift since all inputs count tracks independently starting from 0) new((sdigits[is])[total[is]++]) AliITSDigitUpgrade(*pSDig); } } @@ -104,7 +104,7 @@ void AliITSupgradeDigitizer::Exec(Option_t*) pITS->SDigitsReset(); //close current input and reset }//files loop - AliRunLoader *pOutRunLoader = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); //open output stream (only 1 possible) + AliRunLoader *pOutRunLoader = AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName()); //open output stream (only 1 possible) AliLoader *pOutITSLoader = pOutRunLoader->GetLoader("ITSLoader"); AliRun *pArun = pOutRunLoader->GetAliRun(); AliITSupgrade *pOutITS = (AliITSupgrade*)pArun->GetDetector("ITS"); @@ -201,7 +201,7 @@ void AliITSupgradeDigitizer::Sdigits2Digits(TClonesArray *pSDigitList,TObjArray if(iNtrackPart>maxLab) { AliWarning(Form(" Event %d: Number of summable digits for this pixel (lay=%d,mod=%d,pixId=%lu) is too large (%d<%d). Sum is ok but skipping track Id %d ... ", - fManager->GetOutputEventNr(),ilay,module,pixId,maxLab,iNtrackPart,trackId)); + fDigInput->GetOutputEventNr(),ilay,module,pixId,maxLab,iNtrackPart,trackId)); } eloss+=tmpdig->GetSignal(); nele +=tmpdig->GetNelectrons(); diff --git a/ITS/UPGRADE/AliITSupgradeDigitizer.h b/ITS/UPGRADE/AliITSupgradeDigitizer.h index 92fffccf5a1..3a315f40c56 100644 --- a/ITS/UPGRADE/AliITSupgradeDigitizer.h +++ b/ITS/UPGRADE/AliITSupgradeDigitizer.h @@ -28,10 +28,10 @@ class AliITSupgradeDigitizer : public AliDigitizer //TObject-TNamed-TTask-AliDig { public: AliITSupgradeDigitizer():AliDigitizer(),fNxCells(0),fNzCells(0),fNlayers(0) {;} - AliITSupgradeDigitizer(AliRunDigitizer *pRunDig):AliDigitizer(pRunDig),fNxCells(0),fNzCells(0),fNlayers(0){;} + AliITSupgradeDigitizer(AliDigitizationInput *pRunDig):AliDigitizer(pRunDig),fNxCells(0),fNzCells(0),fNlayers(0){;} virtual ~AliITSupgradeDigitizer() {;} void SetConfiguration(TArrayD xcell, TArrayD zcell); - void Exec(Option_t* option=0); //virtual + void Digitize(Option_t* option=0); //virtual void Sdigits2Digits(TClonesArray *pSDigitList,TObjArray *pDigitLst); diff --git a/MFT/AliMFT.h b/MFT/AliMFT.h index be506be30f6..c8d1c3e64f8 100644 --- a/MFT/AliMFT.h +++ b/MFT/AliMFT.h @@ -77,7 +77,7 @@ public: void ResetDigits() { if(fDigitsPerPlane) for(int iPlane=0; iPlaneAt(iPlane))->Clear(); } // reset digits list void ResetRecPoints() { if(fRecPointsPerPlane) for(int iPlane=0; iPlaneAt(iPlane))->Clear(); } // reset recPoints list - AliDigitizer* CreateDigitizer(AliRunDigitizer *manager) const { return new AliMFTDigitizer(manager); } // from AliModule invoked from AliSimulation::RunDigitization() + AliDigitizer* CreateDigitizer(AliDigitizationInput *digInp) const { return new AliMFTDigitizer(digInp); } // from AliModule invoked from AliSimulation::RunDigitization() AliMFTSegmentation* GetSegmentation() const { return fSegmentation; } diff --git a/MFT/AliMFTDigitizer.cxx b/MFT/AliMFTDigitizer.cxx index bd4dc64a0bb..f6ba7c1a79c 100644 --- a/MFT/AliMFTDigitizer.cxx +++ b/MFT/AliMFTDigitizer.cxx @@ -23,7 +23,7 @@ #include "AliRun.h" #include "AliRunLoader.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliLoader.h" #include "AliLog.h" #include "AliMFTDigitizer.h" @@ -50,8 +50,8 @@ AliMFTDigitizer::AliMFTDigitizer(): //==================================================================================================================================================== -AliMFTDigitizer::AliMFTDigitizer(AliRunDigitizer *pRunDig): - AliDigitizer(pRunDig), +AliMFTDigitizer::AliMFTDigitizer(AliDigitizationInput *digInp) : + AliDigitizer(digInp), fNPlanes(0), fSegmentation(0) { @@ -60,7 +60,7 @@ AliMFTDigitizer::AliMFTDigitizer(AliRunDigitizer *pRunDig): //==================================================================================================================================================== -void AliMFTDigitizer::Exec(Option_t*) { +void AliMFTDigitizer::Digitize(Option_t*) { // This method is responsible for merging sdigits to a list of digits @@ -75,7 +75,7 @@ void AliMFTDigitizer::Exec(Option_t*) { AliDebug(1, Form("nPlanes = %d",fNPlanes)); - AliDebug(1,Form("Start with %i input(s) for event %i", fManager->GetNinputs(), fManager->GetOutputEventNr())); + AliDebug(1,Form("Start with %i input(s) for event %i", fDigInput->GetNinputs(), fDigInput->GetOutputEventNr())); AliRunLoader *pInRunLoader=0; AliLoader *pInMFTLoader=0; @@ -85,9 +85,9 @@ void AliMFTDigitizer::Exec(Option_t*) { // filling the arrays of sdigits... - for (Int_t iFile=0; iFileGetNinputs(); iFile++) { + for (Int_t iFile=0; iFileGetNinputs(); iFile++) { - pInRunLoader = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(iFile)); + pInRunLoader = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(iFile)); pInMFTLoader = pInRunLoader->GetLoader("MFTLoader"); if (!pInMFTLoader) { AliDebug(1,"no MFT lodader, checking in the other input \n"); @@ -109,7 +109,7 @@ void AliMFTDigitizer::Exec(Option_t*) { AliDebug(2, Form("Reading digit %03d of plane %02d (A)", iSDig, iPlane)); AliMFTDigit *pSDig = (AliMFTDigit*) ((TClonesArray*)pInMFT->GetSDigitsList()->At(iPlane))->At(iSDig); AliDebug(2, Form("Reading digit %03d of plane %02d (B)", iSDig, iPlane)); - pSDig->AddOffset2TrackID(fManager->GetMask(iFile)); // -> To be introduced for merging (since all inputs count tracks independently from 0) + pSDig->AddOffset2TrackID(fDigInput->GetMask(iFile)); // -> To be introduced for merging (since all inputs count tracks independently from 0) AliDebug(2, Form("Reading digit %03d of plane %02d (C)", iSDig, iPlane)); new ((sDigits[iPlane])[sDigits[iPlane].GetEntries()]) AliMFTDigit(*pSDig); AliDebug(2, Form("Reading digit %03d of plane %02d (D)", iSDig, iPlane)); @@ -121,7 +121,7 @@ void AliMFTDigitizer::Exec(Option_t*) { } - AliRunLoader *pOutRunLoader = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); // open output stream (only 1 possible) + AliRunLoader *pOutRunLoader = AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName()); // open output stream (only 1 possible) AliLoader *pOutMFTLoader = pOutRunLoader->GetLoader("MFTLoader"); AliRun *pAliRun = pOutRunLoader->GetAliRun(); AliMFT *pOutMFT = (AliMFT*) pAliRun->GetDetector("MFT"); diff --git a/MFT/AliMFTDigitizer.h b/MFT/AliMFTDigitizer.h index d002eaab9cb..e1272b9a3e5 100644 --- a/MFT/AliMFTDigitizer.h +++ b/MFT/AliMFTDigitizer.h @@ -14,7 +14,7 @@ #include "AliRun.h" #include "AliRunLoader.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliLoader.h" #include "AliLog.h" #include "AliMFTDigit.h" @@ -30,10 +30,10 @@ class AliMFTDigitizer : public AliDigitizer { public: AliMFTDigitizer(); - AliMFTDigitizer(AliRunDigitizer *pRunDig); + AliMFTDigitizer(AliDigitizationInput *digInp); virtual ~AliMFTDigitizer() { } - void Exec(Option_t *option); + void Digitize(Option_t *option); void SDigits2Digits(TClonesArray *pSDigitList, TObjArray *pDigitLst); void MergeDigits(AliMFTDigit *mainDig, AliMFTDigit *digToSum); diff --git a/MUON/AliMUON.cxx b/MUON/AliMUON.cxx index 31c0bb3417f..8509e367074 100644 --- a/MUON/AliMUON.cxx +++ b/MUON/AliMUON.cxx @@ -55,7 +55,7 @@ #include "AliLoader.h" #include "AliCDBManager.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliMC.h" #include "AliRun.h" #include "AliRawDataHeaderSim.h" @@ -439,11 +439,11 @@ void AliMUON::SetResponseModel(Int_t id, const AliMUONResponse& response) } //____________________________________________________________________ -AliDigitizer* AliMUON::CreateDigitizer(AliRunDigitizer* manager) const +AliDigitizer* AliMUON::CreateDigitizer(AliDigitizationInput* digInput) const { /// Return digitizer - AliMUONDigitizerV3* digitizer = new AliMUONDigitizerV3(manager, fDigitizerWithNoise); + AliMUONDigitizerV3* digitizer = new AliMUONDigitizerV3(digInput, fDigitizerWithNoise); AliMUONDigitizerV3::SetNSigmas(fDigitizerNSigmas); digitizer->SetCalibrationData(fCalibrationData,GetRecoParam()); return digitizer; @@ -466,7 +466,7 @@ void AliMUON::Hits2SDigits() /// Perform Hits2Digits using SDigitizerV2 AliMUONSDigitizerV2 sdigitizer; - sdigitizer.ExecuteTask(); + sdigitizer.Digitize(); } //_____________________________________________________________________ diff --git a/MUON/AliMUON.h b/MUON/AliMUON.h index 99a6233c45e..a9e21aac94f 100644 --- a/MUON/AliMUON.h +++ b/MUON/AliMUON.h @@ -60,7 +60,7 @@ class AliMUON : public AliDetector virtual void SetSplitLevel(Int_t SplitLevel) {fSplitLevel=SplitLevel;} // Digitisation - virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; + virtual AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const; virtual void SDigits2Digits(); virtual void Hits2SDigits(); virtual void Digits2Raw(); diff --git a/MUON/AliMUONDigitizerV3.cxx b/MUON/AliMUONDigitizerV3.cxx index be668a7133c..4daf311a253 100644 --- a/MUON/AliMUONDigitizerV3.cxx +++ b/MUON/AliMUONDigitizerV3.cxx @@ -47,7 +47,7 @@ #include "AliCodeTimer.h" #include "AliLog.h" #include "AliRun.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliLoader.h" #include "AliRunLoader.h" @@ -110,9 +110,9 @@ ClassImp(AliMUONDigitizerV3) /// \endcond //_____________________________________________________________________________ -AliMUONDigitizerV3::AliMUONDigitizerV3(AliRunDigitizer* manager, +AliMUONDigitizerV3::AliMUONDigitizerV3(AliDigitizationInput* digInput, Int_t generateNoisyDigits) -: AliDigitizer(manager), +: AliDigitizer(digInput), fIsInitialized(kFALSE), fCalibrationData(0x0), fTriggerProcessor(0x0), @@ -130,7 +130,7 @@ fEfficiencyResponse(2*AliMUONConstants::NTriggerCh()*AliMUONConstants::NTriggerC { /// Ctor. - AliDebug(1,Form("AliRunDigitizer=%p",fManager)); + AliDebug(1,Form("AliDigitizationInput=%p",fDigInput)); } @@ -478,9 +478,9 @@ AliMUONDigitizerV3::CreateInputDigitStores() fInputDigitStores->SetOwner(kTRUE); - for ( Int_t iFile = 0; iFile < fManager->GetNinputs(); ++iFile ) + for ( Int_t iFile = 0; iFile < fDigInput->GetNinputs(); ++iFile ) { - AliLoader* inputLoader = GetLoader(fManager->GetInputFolderName(iFile)); + AliLoader* inputLoader = GetLoader(fDigInput->GetInputFolderName(iFile)); inputLoader->LoadSDigits("READ"); @@ -496,7 +496,7 @@ AliMUONDigitizerV3::CreateInputDigitStores() //_____________________________________________________________________________ void -AliMUONDigitizerV3::Exec(Option_t*) +AliMUONDigitizerV3::Digitize(Option_t*) { /// Main method. /// We first loop over input files, and merge the sdigits we found there. @@ -506,7 +506,7 @@ AliMUONDigitizerV3::Exec(Option_t*) AliCodeTimerAuto("",0) - if ( fManager->GetNinputs() == 0 ) + if ( fDigInput->GetNinputs() == 0 ) { AliWarning("No input set. Nothing to do."); return; @@ -518,9 +518,9 @@ AliMUONDigitizerV3::Exec(Option_t*) return; } - Int_t nInputFiles = fManager->GetNinputs(); + Int_t nInputFiles = fDigInput->GetNinputs(); - AliLoader* outputLoader = GetLoader(fManager->GetOutputFolderName()); + AliLoader* outputLoader = GetLoader(fDigInput->GetOutputFolderName()); outputLoader->MakeDigitsContainer(); @@ -536,7 +536,7 @@ AliMUONDigitizerV3::Exec(Option_t*) for ( Int_t iFile = 0; iFile < nInputFiles; ++iFile ) { - AliLoader* inputLoader = GetLoader(fManager->GetInputFolderName(iFile)); + AliLoader* inputLoader = GetLoader(fDigInput->GetInputFolderName(iFile)); inputLoader->LoadSDigits("READ"); @@ -557,7 +557,7 @@ AliMUONDigitizerV3::Exec(Option_t*) iTreeS->GetEvent(0); - MergeWithSDigits(fDigitStore,*dstore,fManager->GetMask(iFile)); + MergeWithSDigits(fDigitStore,*dstore,fDigInput->GetMask(iFile)); inputLoader->UnloadSDigits(); @@ -845,7 +845,7 @@ AliMUONDigitizerV3::GetLoader(const TString& folderName) Bool_t AliMUONDigitizerV3::Init() { - /// Initialization of the TTask : + /// Initialization of the digitization : /// a) create the calibrationData, according to run number /// b) create the trigger processing task @@ -857,9 +857,9 @@ AliMUONDigitizerV3::Init() return kFALSE; } - if (!fManager) + if (!fDigInput) { - AliError("fManager is null !"); + AliError("fDigInput is null !"); return kFALSE; } diff --git a/MUON/AliMUONDigitizerV3.h b/MUON/AliMUONDigitizerV3.h index 7f3d0829fad..30bb5b1de5a 100644 --- a/MUON/AliMUONDigitizerV3.h +++ b/MUON/AliMUONDigitizerV3.h @@ -36,12 +36,12 @@ class AliMUONTriggerUtilities; class AliMUONDigitizerV3 : public AliDigitizer { public: - AliMUONDigitizerV3(AliRunDigitizer* manager=0, + AliMUONDigitizerV3(AliDigitizationInput* digInput=0, Int_t generateNoisyDigits=1); virtual ~AliMUONDigitizerV3(); - virtual void Exec(Option_t* opt=""); + virtual void Digitize(Option_t* opt=""); virtual Bool_t Init(); diff --git a/MUON/AliMUONSDigitizerV2.cxx b/MUON/AliMUONSDigitizerV2.cxx index 3b00f878450..4d80e984c90 100644 --- a/MUON/AliMUONSDigitizerV2.cxx +++ b/MUON/AliMUONSDigitizerV2.cxx @@ -67,7 +67,7 @@ Float_t AliMUONSDigitizerV2::fgkMinTimeDif = 25E-9; //_____________________________________________________________________________ AliMUONSDigitizerV2::AliMUONSDigitizerV2() -: TTask("AliMUONSDigitizerV2","From Hits to SDigits for MUON") +: TNamed("AliMUONSDigitizerV2","From Hits to SDigits for MUON") { /// /// ctor. @@ -89,7 +89,7 @@ AliMUONSDigitizerV2::~AliMUONSDigitizerV2() //_____________________________________________________________________________ void -AliMUONSDigitizerV2::Exec(Option_t*) +AliMUONSDigitizerV2::Digitize(Option_t*) { /// /// Go from hits to sdigits. diff --git a/MUON/AliMUONSDigitizerV2.h b/MUON/AliMUONSDigitizerV2.h index 4a88675966b..f0123e28bfe 100644 --- a/MUON/AliMUONSDigitizerV2.h +++ b/MUON/AliMUONSDigitizerV2.h @@ -18,17 +18,15 @@ #ifndef ALIMUONSDIGITIZERV2_H #define ALIMUONSDIGITIZERV2_H -#ifndef ROOT_TTask -# include "TTask.h" -#endif +#include "TNamed.h" -class AliMUONSDigitizerV2 : public TTask +class AliMUONSDigitizerV2 : public TNamed { public: AliMUONSDigitizerV2(); virtual ~AliMUONSDigitizerV2(); - virtual void Exec(Option_t* opt=""); + virtual void Digitize(Option_t* opt=""); private: static Float_t fgkMaxIntTime; ///< maximum time of interaction @@ -36,7 +34,7 @@ private: static Float_t fgkMaxNegTimeDif; ///< maximum event time before the triggered event for a hit to be digitized static Float_t fgkMinTimeDif; ///< minimum time difference for the reduction factor to be applied - ClassDef(AliMUONSDigitizerV2,1) // MUON SDigitizer V2-1 + ClassDef(AliMUONSDigitizerV2,2) // MUON SDigitizer V2-1 }; #endif diff --git a/MUON/Doxymodules_STEER.h b/MUON/Doxymodules_STEER.h index 4d7d19cde63..10b7b6f49d8 100644 --- a/MUON/Doxymodules_STEER.h +++ b/MUON/Doxymodules_STEER.h @@ -122,7 +122,7 @@ class AliDebugVolume {}; class AliConfig {}; class AliDigitizer {}; - class AliRunDigitizer {}; + class AliDigitizationInput {}; class AliStream {}; class AliMergeCombi {}; class AliGausCorr {}; diff --git a/PHOS/AliPHOS.cxx b/PHOS/AliPHOS.cxx index d0d882a62d5..8c0e9e8fddc 100644 --- a/PHOS/AliPHOS.cxx +++ b/PHOS/AliPHOS.cxx @@ -126,9 +126,9 @@ AliPHOS::~AliPHOS() } //____________________________________________________________________________ -AliDigitizer* AliPHOS::CreateDigitizer(AliRunDigitizer* manager) const +AliDigitizer* AliPHOS::CreateDigitizer(AliDigitizationInput* digInput) const { - return new AliPHOSDigitizer(manager); + return new AliPHOSDigitizer(digInput); } //____________________________________________________________________________ @@ -561,7 +561,7 @@ void AliPHOS::Hits2SDigits() AliPHOSSDigitizer phosDigitizer(fLoader->GetRunLoader()->GetFileName().Data()) ; phosDigitizer.SetEventRange(0, -1) ; // do all the events - phosDigitizer.ExecuteTask("all") ; + phosDigitizer.Digitize("all") ; } diff --git a/PHOS/AliPHOS.h b/PHOS/AliPHOS.h index 079ed452dd5..f1ce3c47323 100644 --- a/PHOS/AliPHOS.h +++ b/PHOS/AliPHOS.h @@ -57,7 +57,6 @@ // --- ROOT system --- class TString ; -class TTask ; class TFolder ; class TTree ; class TRandom ; @@ -83,7 +82,7 @@ public: } virtual void AddHit( Int_t shunt, Int_t primary, Int_t track, Int_t id, Float_t *hits ) = 0 ; - virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; + virtual AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const; virtual void CreateMaterials() ; virtual void Digits2Raw(); virtual Bool_t Raw2SDigits(AliRawReader* rawReader); diff --git a/PHOS/AliPHOSDigitizer.cxx b/PHOS/AliPHOSDigitizer.cxx index 2f5c44f7eaa..f193db478b3 100644 --- a/PHOS/AliPHOSDigitizer.cxx +++ b/PHOS/AliPHOSDigitizer.cxx @@ -83,12 +83,12 @@ //_________________________________________________________________________ //*-- Author : Dmitri Peressounko (SUBATECH & Kurchatov Institute) ////////////////////////////////////////////////////////////////////////////// -// This TTask performs digitization of Summable digits (in the PHOS case it is just +// This class performs digitization of Summable digits (in the PHOS case it is just // the sum of contributions from all primary particles into a given cell). // In addition it performs mixing of summable digits from different events. -// The name of the TTask is also the title of the branch that will contain +// The name of the class is also the title of the branch that will contain // the created SDigits -// The title of the TTAsk is the name of the file that contains the hits from +// The title of the class is the name of the file that contains the hits from // which the SDigits are created // // For each event two branches are created in TreeD: @@ -100,7 +100,7 @@ // // Use case: // root[0] AliPHOSDigitizer * d = new AliPHOSDigitizer() ; -// root[1] d->ExecuteTask() +// root[1] d->Digitize() // Warning in : object already instantiated // //Digitizes SDigitis in all events found in file galice.root // @@ -111,7 +111,7 @@ // // Reads another set of sdigits from galice2.root // root[3] d1->MixWith("galice3.root") // // Reads another set of sdigits from galice3.root -// root[4] d->ExecuteTask("deb timing") +// root[4] d->Digitize("deb timing") // // Reads SDigits from files galice1.root, galice2.root .... // // mixes them and stores produced Digits in file galice1.root // // deb - prints number of produced digits @@ -131,7 +131,7 @@ // --- AliRoot header files --- #include #include "AliLog.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliPHOSDigit.h" #include "AliPHOSDigitizer.h" #include "AliPHOSGeometry.h" @@ -166,13 +166,13 @@ AliPHOSDigitizer::AliPHOSDigitizer() : { // ctor InitParameters() ; - fManager = 0 ; // We work in the standalong mode + fDigInput = 0 ; // We work in the standalong mode } //____________________________________________________________________________ AliPHOSDigitizer::AliPHOSDigitizer(TString alirunFileName, TString eventFolderName): - AliDigitizer("PHOS"+AliConfig::Instance()->GetDigitizerTaskName(), alirunFileName), + AliDigitizer("PHOSDigitizer", alirunFileName), fDefaultInit(kFALSE), fDigitsInRun(0), fInit(kFALSE), @@ -193,7 +193,7 @@ AliPHOSDigitizer::AliPHOSDigitizer(TString alirunFileName, InitParameters() ; Init() ; fDefaultInit = kFALSE ; - fManager = 0 ; // We work in the standalone mode + fDigInput = 0 ; // We work in the standalone mode fcdb = new AliPHOSCalibData(-1); } @@ -223,8 +223,8 @@ AliPHOSDigitizer::AliPHOSDigitizer(const AliPHOSDigitizer & d) : } //____________________________________________________________________________ -AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * rd) : - AliDigitizer(rd,"PHOS"+AliConfig::Instance()->GetDigitizerTaskName()), +AliPHOSDigitizer::AliPHOSDigitizer(AliDigitizationInput * rd) : + AliDigitizer(rd,"PHOSDigitizer"), fDefaultInit(kFALSE), fDigitsInRun(0), fInit(kFALSE), @@ -232,7 +232,7 @@ AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * rd) : fInputFileNames(0x0), fEventNames(0x0), fEmcCrystals(0), - fEventFolderName(fManager->GetInputFolderName(0)), + fEventFolderName(fDigInput->GetInputFolderName(0)), fFirstEvent(0), fLastEvent(0), fcdb (0x0), @@ -243,8 +243,8 @@ AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * rd) : { // ctor Init() is called by RunDigitizer - fManager = rd ; - SetTitle(static_cast(fManager->GetInputStream(0))->GetFileName(0)); + fDigInput = rd ; + SetTitle(static_cast(fDigInput->GetInputStream(0))->GetFileName(0)); InitParameters() ; fDefaultInit = kFALSE ; fcdb = new AliPHOSCalibData(-1); @@ -253,15 +253,7 @@ AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * rd) : //____________________________________________________________________________ AliPHOSDigitizer::~AliPHOSDigitizer() { - // dtor - AliRunLoader* rl = AliRunLoader::GetRunLoader(fEventFolderName) ; - if(rl){ - AliPHOSLoader * phosLoader = static_cast(rl->GetLoader("PHOSLoader")); - - if(phosLoader) - phosLoader->CleanDigitizer() ; - } - + // dtor delete [] fInputFileNames ; delete [] fEventNames ; @@ -291,8 +283,8 @@ void AliPHOSDigitizer::Digitize(Int_t event) AliPHOSLoader * phosLoader = static_cast(rl->GetLoader("PHOSLoader")); Int_t readEvent = event ; - if (fManager) - readEvent = static_cast(fManager->GetInputStream(0))->GetCurrentEventNumber() ; + if (fDigInput) + readEvent = static_cast(fDigInput->GetInputStream(0))->GetCurrentEventNumber() ; AliDebug(1,Form("Adding event %d from input stream 0 %s %s", readEvent, GetTitle(), fEventFolderName.Data())) ; rl->GetEvent(readEvent) ; @@ -369,8 +361,8 @@ void AliPHOSDigitizer::Digitize(Int_t event) } AliPHOSLoader * phosLoader2 = static_cast(rl2->GetLoader("PHOSLoader")); - if(fManager){ - readEvent = static_cast(fManager->GetInputStream(i))->GetCurrentEventNumber() ; + if(fDigInput){ + readEvent = static_cast(fDigInput->GetInputStream(i))->GetCurrentEventNumber() ; } TClonesArray * digs ; if(AliPHOSSimParam::GetInstance()->IsStreamDigits(i)){ //This is Digits Stream @@ -464,8 +456,8 @@ void AliPHOSDigitizer::Digitize(Int_t event) while(curSDigit && curSDigit->GetId() == absID){ //Shift primary to separate primaries belonging different inputs Int_t primaryoffset ; - if(fManager) - primaryoffset = fManager->GetMask(i) ; + if(fDigInput) + primaryoffset = fDigInput->GetMask(i) ; else primaryoffset = 10000000*i ; curSDigit->ShiftPrimary(primaryoffset) ; @@ -569,8 +561,8 @@ void AliPHOSDigitizer::Digitize(Int_t event) while(curSDigit && curSDigit->GetId() == absID){ //Shift primary to separate primaries belonging different inputs Int_t primaryoffset ; - if(fManager) - primaryoffset = fManager->GetMask(i) ; + if(fDigInput) + primaryoffset = fDigInput->GetMask(i) ; else primaryoffset = 10000000*i ; curSDigit->ShiftPrimary(primaryoffset) ; @@ -744,7 +736,7 @@ Int_t AliPHOSDigitizer::DigitizeCPV(Float_t charge, Int_t absId) } //____________________________________________________________________________ -void AliPHOSDigitizer::Exec(Option_t *option) +void AliPHOSDigitizer::Digitize(Option_t *option) { // Steering method to process digitization for events // in the range from fFirstEvent to fLastEvent. @@ -768,13 +760,10 @@ void AliPHOSDigitizer::Exec(Option_t *option) AliRunLoader* rl = AliRunLoader::GetRunLoader(fEventFolderName) ; AliPHOSLoader * phosLoader = static_cast(rl->GetLoader("PHOSLoader")); - - // Post Digitizer to the white board - phosLoader->PostDigitizer(this) ; if (fLastEvent == -1) fLastEvent = rl->GetNumberOfEvents() - 1 ; - else if (fManager) + else if (fDigInput) fLastEvent = fFirstEvent ; Int_t nEvents = fLastEvent - fFirstEvent + 1; @@ -795,8 +784,6 @@ void AliPHOSDigitizer::Exec(Option_t *option) fDigitsInRun += phosLoader->Digits()->GetEntriesFast() ; } - phosLoader->CleanDigitizer(); - if(strstr(option,"tim")){ gBenchmark->Stop("PHOSDigitizer"); TString message ; @@ -851,8 +838,8 @@ Bool_t AliPHOSDigitizer::Init() fFirstEvent = 0 ; fLastEvent = fFirstEvent ; - if (fManager) - fInput = fManager->GetNinputs() ; + if (fDigInput) + fInput = fDigInput->GetNinputs() ; else fInput = 1 ; @@ -862,9 +849,9 @@ Bool_t AliPHOSDigitizer::Init() fEventNames[0] = fEventFolderName.Data() ; Int_t index ; for (index = 1 ; index < fInput ; index++) { - fInputFileNames[index] = static_cast(fManager->GetInputStream(index))->GetFileName(0); - TString tempo = fManager->GetInputFolderName(index) ; - fEventNames[index] = tempo.Remove(tempo.Length()-1) ; // strip of the stream number added by fManager + fInputFileNames[index] = static_cast(fDigInput->GetInputStream(index))->GetFileName(0); + TString tempo = fDigInput->GetInputFolderName(index) ; + fEventNames[index] = tempo.Remove(tempo.Length()-1) ; // strip of the stream number added by fDigInput } //to prevent cleaning of this object while GetEvent is called @@ -872,9 +859,6 @@ Bool_t AliPHOSDigitizer::Init() if(!rl){ rl = AliRunLoader::Open(GetTitle(), fEventFolderName) ; } - AliPHOSLoader * phosLoader = static_cast(rl->GetLoader("PHOSLoader")); - phosLoader->GetDigitsDataLoader()->GetBaseTaskLoader()->SetDoNotReload(kTRUE); - return fInit ; } @@ -900,7 +884,7 @@ void AliPHOSDigitizer::Print(const Option_t *)const printf(" Writing Digits to branch with title %s\n", fEventFolderName.Data()) ; Int_t nStreams ; - if (fManager) + if (fDigInput) nStreams = GetNInputStreams() ; else nStreams = fInput ; @@ -1042,7 +1026,6 @@ void AliPHOSDigitizer::WriteDigits() digitsBranch->Fill() ; phosLoader->WriteDigits("OVERWRITE"); - phosLoader->WriteDigitizer("OVERWRITE"); Unload() ; diff --git a/PHOS/AliPHOSDigitizer.h b/PHOS/AliPHOSDigitizer.h index 58e92b17ac8..bfe31b1c4b4 100644 --- a/PHOS/AliPHOSDigitizer.h +++ b/PHOS/AliPHOSDigitizer.h @@ -45,7 +45,7 @@ class TClonesArray ; #include "AliDigitizer.h" #include "AliConfig.h" #include "AliPHOSPulseGenerator.h" -class AliRunDigitizer ; +class AliDigitizationInput ; class AliPHOSCalibData ; class AliPHOSDigitizer: public AliDigitizer { @@ -54,11 +54,11 @@ public: AliPHOSDigitizer() ; // ctor AliPHOSDigitizer(TString alirunFileNameFile, TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ; AliPHOSDigitizer(const AliPHOSDigitizer & dtizer) ; - AliPHOSDigitizer(AliRunDigitizer * manager) ; + AliPHOSDigitizer(AliDigitizationInput * digInput) ; virtual ~AliPHOSDigitizer() ; void Digitize(Int_t event) ; // Make Digits from SDigits - void Exec(Option_t *option); // Supervising method + void Digitize(Option_t *option); // Supervising method void SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; } diff --git a/PHOS/AliPHOSLoader.cxx b/PHOS/AliPHOSLoader.cxx index ca11c1e1526..0a90d24fc56 100644 --- a/PHOS/AliPHOSLoader.cxx +++ b/PHOS/AliPHOSLoader.cxx @@ -137,7 +137,7 @@ void AliPHOSLoader::CleanFolders() Int_t AliPHOSLoader::SetEvent() { //Cleans loaded stuff and and sets Files and Directories -// do not post any data to folder/tasks +// do not post any data to folder Int_t retval = AliLoader::SetEvent(); diff --git a/PHOS/AliPHOSLoader.h b/PHOS/AliPHOSLoader.h index edf7b80ada7..fec7377cf3e 100644 --- a/PHOS/AliPHOSLoader.h +++ b/PHOS/AliPHOSLoader.h @@ -33,7 +33,6 @@ // --- ROOT system --- class TString ; class TParticle ; -class TTask ; #include #include @@ -93,11 +92,6 @@ public: void CleanTracks()const; void CleanRecParticles(); -//up to now it is only here -> no definition about global/incremental tracking/PID - -// Int_t WriteRecParticles(Option_t* opt="");//writes the reconstructed particles -// Int_t WritePID(Option_t* opt="");//writes the task for PID to file -// Bool_t PostPID (AliPHOSPID * pid) const {return kTRUE;} /*******************************************************************/ /*******************************************************************/ @@ -115,7 +109,7 @@ public: static AliPHOSLoader* GetPHOSLoader(const char* eventfoldername); - //Method to be used when digitizing under AliRunDigitizer, who opens all files etc. + //Method to be used when digitizing under AliDigitizationInput, who opens all files etc. Int_t EventNumber() { return (Int_t) GetRunLoader()->GetEventNumber();} Int_t MaxEvent() { return (Int_t) GetRunLoader()->TreeE()->GetEntries();} @@ -153,23 +147,6 @@ public: TClonesArray * RecParticles() ; const AliPHOSRecParticle * RecParticle(Int_t index); void MakeRecParticlesArray(); - - /*********************************************/ - /************ T A S K S **************/ - /*********************************************/ - // - // AliPHOSSDigitizer* PHOSSDigitizer(TString name = AliConfig::GetDefaultEventFolderName()); - //AliPHOSDigitizer* PHOSDigitizer() { return dynamic_cast(Digitizer()) ;} - - AliPHOSPID * PID () const {return dynamic_cast(PIDTask()) ;} - Int_t LoadPID(Option_t * opt="") const {return LoadPIDTask(opt);} - Int_t WritePID(Option_t * opt="") const {return WritePIDTask(opt);} - - - AliPHOSTrackSegmentMaker * TrackSegmentMaker () const { return dynamic_cast(Tracker()) ;} - Int_t LoadTrackSegmentMaker(Option_t * opt="") const {return LoadTracker(opt);} - Int_t WriteTrackSegmentMaker(Option_t * opt="") const {return WriteTracker(opt);} - void SetDebug(Int_t level) {fDebug = level;} // Set debug level void SetBranchTitle(const TString& btitle); diff --git a/PHOS/AliPHOSSDigitizer.cxx b/PHOS/AliPHOSSDigitizer.cxx index a74938a8123..7ef781f3980 100644 --- a/PHOS/AliPHOSSDigitizer.cxx +++ b/PHOS/AliPHOSSDigitizer.cxx @@ -56,7 +56,7 @@ // User case: // root [0] AliPHOSSDigitizer * s = new AliPHOSSDigitizer("galice.root") // Warning in : object already instantiated -// root [1] s->ExecuteTask() +// root [1] s->Digitize() // // Makes SDigitis for all events stored in galice.root // root [2] s->SetPedestalParameter(0.001) // // One can change parameters of digitization @@ -90,7 +90,7 @@ ClassImp(AliPHOSSDigitizer) //____________________________________________________________________________ AliPHOSSDigitizer::AliPHOSSDigitizer() : - TTask("",""), + TNamed("",""), fPrimThreshold(0.f), fDefaultInit(kTRUE), fEventFolderName(""), @@ -106,7 +106,7 @@ AliPHOSSDigitizer::AliPHOSSDigitizer() : //____________________________________________________________________________ AliPHOSSDigitizer::AliPHOSSDigitizer(const char * alirunFileName, const char * eventFolderName): - TTask("PHOS"+AliConfig::Instance()->GetSDigitizerTaskName(), alirunFileName), + TNamed("PHOSSDigitizer", alirunFileName), fPrimThreshold(0.f), fDefaultInit(kFALSE), fEventFolderName(eventFolderName), @@ -123,7 +123,7 @@ AliPHOSSDigitizer::AliPHOSSDigitizer(const char * alirunFileName, //____________________________________________________________________________ AliPHOSSDigitizer::AliPHOSSDigitizer(const AliPHOSSDigitizer& sd) : - TTask(sd.GetName(), sd.GetTitle()), + TNamed(sd.GetName(), sd.GetTitle()), fPrimThreshold(sd.fPrimThreshold), fDefaultInit(kFALSE), fEventFolderName(sd.fEventFolderName), @@ -146,15 +146,9 @@ AliPHOSSDigitizer& AliPHOSSDigitizer::operator = (const AliPHOSSDigitizer& qa) } //____________________________________________________________________________ -AliPHOSSDigitizer::~AliPHOSSDigitizer() { +AliPHOSSDigitizer::~AliPHOSSDigitizer() +{ //dtor - AliRunLoader* rl = AliRunLoader::GetRunLoader(fEventFolderName) ; - if(rl){ - AliPHOSLoader * phosLoader = - static_cast(rl->GetLoader("PHOSLoader")); - if(phosLoader) - phosLoader->CleanSDigitizer() ; - } } //____________________________________________________________________________ @@ -166,12 +160,7 @@ void AliPHOSSDigitizer::Init() //to prevent cleaning of this object while GetEvent is called AliRunLoader* rl = AliRunLoader::GetRunLoader(fEventFolderName) ; - if (!rl) - rl = AliRunLoader::Open(GetTitle(), fEventFolderName) ; - - AliPHOSLoader * phosLoader = static_cast(rl->GetLoader("PHOSLoader")); - phosLoader->PostSDigitizer(this); - phosLoader->GetSDigitsDataLoader()->GetBaseTaskLoader()->SetDoNotReload(kTRUE); + if (!rl) rl = AliRunLoader::Open(GetTitle(), fEventFolderName) ; } //____________________________________________________________________________ @@ -183,7 +172,7 @@ void AliPHOSSDigitizer::InitParameters() } //____________________________________________________________________________ -void AliPHOSSDigitizer::Exec(Option_t *option) +void AliPHOSSDigitizer::Digitize(Option_t *option) { // Steering method to produce summable digits for events // in the range from fFirstEvent to fLastEvent. @@ -301,7 +290,6 @@ void AliPHOSSDigitizer::Exec(Option_t *option) sdigitsBranch->Fill() ; phosLoader->WriteSDigits("OVERWRITE"); - phosLoader->WriteSDigitizer("OVERWRITE"); if(strstr(option,"deb")) PrintSDigits(option) ; diff --git a/PHOS/AliPHOSSDigitizer.h b/PHOS/AliPHOSSDigitizer.h index c7c1ddb1017..d3b734ec167 100644 --- a/PHOS/AliPHOSSDigitizer.h +++ b/PHOS/AliPHOSSDigitizer.h @@ -30,7 +30,7 @@ */ //_________________________________________________________________________ -// Task Class for making SDigits in PHOS +// Class for making SDigits in PHOS // A Summable Digits is the sum of all hits originating // from one primary in one active cell //*-- @@ -38,7 +38,7 @@ // --- ROOT system --- -#include "TTask.h" +#include "TNamed.h" #include "AliConfig.h" class TFile ; @@ -48,7 +48,7 @@ class TFile ; // --- AliRoot header files --- //class AliPHOSQADataMaker ; -class AliPHOSSDigitizer: public TTask { +class AliPHOSSDigitizer: public TNamed { public: AliPHOSSDigitizer() ; // ctor @@ -58,8 +58,8 @@ public: virtual ~AliPHOSSDigitizer(); // dtor - virtual void Exec(Option_t *option); - Int_t GetSDigitsInRun() const {return fSDigitsInRun ;} + virtual void Digitize(Option_t *option); + Int_t GetSDigitsInRun() const {return fSDigitsInRun ;} virtual void Print(const Option_t * = "") const ; void SetEventFolderName(TString name) { fEventFolderName = name ; } void SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; } @@ -84,7 +84,7 @@ private: Int_t fFirstEvent; // first event to process Int_t fLastEvent; // last event to process - ClassDef(AliPHOSSDigitizer,5) // description + ClassDef(AliPHOSSDigitizer,6) // description }; diff --git a/PMD/AliPMD.cxx b/PMD/AliPMD.cxx index b4fc4ae673f..6d672eca82f 100644 --- a/PMD/AliPMD.cxx +++ b/PMD/AliPMD.cxx @@ -316,9 +316,9 @@ void AliPMD::Hits2Digits() } // --------------------------------------------------------------------------- -AliDigitizer* AliPMD::CreateDigitizer(AliRunDigitizer* manager) const +AliDigitizer* AliPMD::CreateDigitizer(AliDigitizationInput* digInput) const { - return new AliPMDDigitizer(manager); + return new AliPMDDigitizer(digInput); } // --------------------------------------------------------------------------- void AliPMD::Digits2Raw() diff --git a/PMD/AliPMD.h b/PMD/AliPMD.h index 700489a9460..c5363e417d4 100644 --- a/PMD/AliPMD.h +++ b/PMD/AliPMD.h @@ -48,7 +48,7 @@ public: virtual void SDigits2Digits(); virtual void Hits2Digits(); - virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; + virtual AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const; virtual void Digits2Raw(); virtual Bool_t Raw2SDigits(AliRawReader *rawReader); diff --git a/PMD/AliPMDDigitizer.cxx b/PMD/AliPMDDigitizer.cxx index 39171b4418e..d77c940d409 100644 --- a/PMD/AliPMDDigitizer.cxx +++ b/PMD/AliPMDDigitizer.cxx @@ -40,7 +40,7 @@ #include "AliLoader.h" #include "AliConfig.h" #include "AliMagF.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliDigitizer.h" #include "AliHeader.h" #include "AliCDBManager.h" @@ -128,8 +128,8 @@ AliPMDDigitizer & AliPMDDigitizer::operator=(const AliPMDDigitizer& /*digitizer* return *this; } //____________________________________________________________________________ -AliPMDDigitizer::AliPMDDigitizer(AliRunDigitizer* manager): - AliDigitizer(manager), +AliPMDDigitizer::AliPMDDigitizer(AliDigitizationInput* digInput): + AliDigitizer(digInput), fRunLoader(0), fPMDHit(0), fPMD(0), @@ -863,7 +863,7 @@ void AliPMDDigitizer::SDigits2Digits(Int_t ievt) } //____________________________________________________________________________ -void AliPMDDigitizer::Exec(Option_t *option) +void AliPMDDigitizer::Digitize(Option_t *option) { // Does the event merging and digitization const char *cdeb = strstr(option,"deb"); @@ -872,17 +872,17 @@ void AliPMDDigitizer::Exec(Option_t *option) AliDebug(100," *** PMD Exec is called ***"); } - Int_t ninputs = fManager->GetNinputs(); + Int_t ninputs = fDigInput->GetNinputs(); AliDebug(1,Form("Number of files to be processed = %d",ninputs)); ResetCellADC(); for (Int_t i = 0; i < ninputs; i++) { - Int_t troffset = fManager->GetMask(i); + Int_t troffset = fDigInput->GetMask(i); MergeSDigits(i, troffset); } - fRunLoader = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); + fRunLoader = AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName()); fPMD = (AliPMD*)gAlice->GetDetector("PMD"); fPMDLoader = fRunLoader->GetLoader("PMDLoader"); if (fPMDLoader == 0x0) @@ -1175,7 +1175,7 @@ void AliPMDDigitizer::TrackAssignment2CPVCell() void AliPMDDigitizer::MergeSDigits(Int_t filenumber, Int_t troffset) { // merging sdigits - fRunLoader = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(filenumber)); + fRunLoader = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(filenumber)); fPMDLoader = fRunLoader->GetLoader("PMDLoader"); fPMDLoader->LoadSDigits("read"); TTree* treeS = fPMDLoader->TreeS(); diff --git a/PMD/AliPMDDigitizer.h b/PMD/AliPMDDigitizer.h index 40d128f783e..004beb23505 100644 --- a/PMD/AliPMDDigitizer.h +++ b/PMD/AliPMDDigitizer.h @@ -28,7 +28,7 @@ class AliDetector; class AliPMDhit; class AliHit; class AliHeader; -class AliRunDigitizer; +class AliDigitizationInput; class AliCDBManager; class AliCDBStorage; @@ -45,7 +45,7 @@ class AliPMDDigitizer:public AliDigitizer AliPMDDigitizer(); AliPMDDigitizer(const AliPMDDigitizer &digitizer); // copy constructor AliPMDDigitizer &operator=(const AliPMDDigitizer &digitizer); // assign op - AliPMDDigitizer(AliRunDigitizer *manager); + AliPMDDigitizer(AliDigitizationInput* digInput); virtual ~AliPMDDigitizer(); void OpengAliceFile(const char *file, Option_t *option); @@ -53,7 +53,7 @@ class AliPMDDigitizer:public AliDigitizer void Hits2SDigits(Int_t ievt); void Hits2Digits(Int_t ievt); void SDigits2Digits(Int_t ievt); - void Exec(Option_t *option); + void Digitize(Option_t *option); void MergeSDigits(Int_t filenumber, Int_t troffset); void TrackAssignment2CPVCell(); void TrackAssignment2Cell(); diff --git a/PWG4/PartCorrBase/AliCaloPID.cxx b/PWG4/PartCorrBase/AliCaloPID.cxx index 4dfd254a996..3034e32cd2b 100755 --- a/PWG4/PartCorrBase/AliCaloPID.cxx +++ b/PWG4/PartCorrBase/AliCaloPID.cxx @@ -42,6 +42,7 @@ // --- ROOT system --- #include #include +#include //---- ANALYSIS system ---- #include "AliCaloPID.h" @@ -101,7 +102,7 @@ fhTrackMatchedDEta(0x0), fhTrackMatchedDPhi(0x0), fhTrackMatchedDEtaDPhi(0x } //________________________________________________ -AliCaloPID::AliCaloPID(const TTask * emcalpid) : +AliCaloPID::AliCaloPID(const TNamed * emcalpid) : TObject(), fEMCALPhotonWeight(0.), fEMCALPi0Weight(0.), fEMCALElectronWeight(0.), fEMCALChargeWeight(0.), fEMCALNeutralWeight(0.), diff --git a/PWG4/PartCorrBase/AliCaloPID.h b/PWG4/PartCorrBase/AliCaloPID.h index 1966449c0a4..0028f6a8152 100755 --- a/PWG4/PartCorrBase/AliCaloPID.h +++ b/PWG4/PartCorrBase/AliCaloPID.h @@ -32,7 +32,7 @@ class TString ; class TLorentzVector ; #include -class TTask; +class TList; class TH2F ; //--- AliRoot system --- @@ -47,7 +47,7 @@ class AliCaloPID : public TObject { AliCaloPID() ; // ctor AliCaloPID(const Int_t particleFlux) ; // ctor, to be used when recalculating bayesian PID - AliCaloPID(const TTask * emcalpid) ; // ctor, to be used when recalculating bayesian PID and need different parameters + AliCaloPID(const TNamed * emcalpid) ; // ctor, to be used when recalculating bayesian PID and need different parameters virtual ~AliCaloPID() ;//virtual dtor private: diff --git a/STEER/AliHMPIDPIDResponse.cxx b/STEER/AliHMPIDPIDResponse.cxx index 3694de05eb2..d0d2c22ad42 100644 --- a/STEER/AliHMPIDPIDResponse.cxx +++ b/STEER/AliHMPIDPIDResponse.cxx @@ -28,7 +28,7 @@ #include //Resolution() //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -AliHMPIDPid::AliHMPIDPid():TTask("HMPIDrec","HMPIDPid") +AliHMPIDPid::AliHMPIDPid():TNamed("HMPIDrec","HMPIDPid") { //.. //init of data members diff --git a/STEER/AliHMPIDPIDResponse.h b/STEER/AliHMPIDPIDResponse.h index b3bd0fb3052..80063658667 100644 --- a/STEER/AliHMPIDPIDResponse.h +++ b/STEER/AliHMPIDPIDResponse.h @@ -13,11 +13,11 @@ ////////////////////////////////////////////////////////////////////////// -#include //base class +#include //base class class AliESDtrack; -class AliHMPIDPIDResponse : public TTask +class AliHMPIDPIDResponse : public TNamed { public : AliHMPIDPIDResponse(); //ctor diff --git a/STEER/CMakelibSTEER.pkg b/STEER/CMakelibSTEER.pkg index 045723e8a4e..0b9201d66a7 100644 --- a/STEER/CMakelibSTEER.pkg +++ b/STEER/CMakelibSTEER.pkg @@ -7,7 +7,6 @@ set ( SRCS STEER/AliObjectLoader.cxx STEER/AliBaseLoader.cxx STEER/AliTreeLoader.cxx - STEER/AliTaskLoader.cxx STEER/AliDetector.cxx STEER/AliDigit.cxx STEER/AliHit.cxx @@ -28,7 +27,7 @@ set ( SRCS STEER/AliRndm.cxx STEER/AliDebugVolume.cxx STEER/AliConfig.cxx - STEER/AliRunDigitizer.cxx + STEER/AliDigitizationInput.cxx STEER/AliDigitizer.cxx STEER/AliStream.cxx STEER/AliMergeCombi.cxx diff --git a/STEER/STEER/AliConfig.cxx b/STEER/STEER/AliConfig.cxx index d022a8fd1c7..e18616db787 100644 --- a/STEER/STEER/AliConfig.cxx +++ b/STEER/STEER/AliConfig.cxx @@ -33,7 +33,6 @@ #include #include #include -#include #include #include "AliConfig.h" @@ -42,23 +41,11 @@ #include "AliLoader.h" #include "AliLog.h" -enum - { - kDetTaskQA = 0, - kDetTaskSDigitizer, - kDetTaskDigitizer, - kDetTaskRecontructioner, - kDetTaskTracker, - kDetTaskPID, - kDetTaskLast - }; - enum { kDetFolderData = 0, kDetFolderCalibration, kDetFolderAligmnet, - kDetFolderQA, kDetFolderLast }; ClassImp(AliConfig) @@ -69,7 +56,6 @@ AliConfig* AliConfig::fgInstance = 0; const TString AliConfig::fgkTopFolderName("Folders"); //1st level folder -const TString AliConfig::fgkTasksFolderName("Tasks"); //task folder, commn const TString AliConfig::fgkConstantsFolderName("Constants"); const TString AliConfig::fgkDefaultEventFolderName("Event"); //default folder for event, always used except merging @@ -81,19 +67,10 @@ const TString AliConfig::fgkConditionsFolderName("Conditions");//folder with con const TString AliConfig::fgkConfigurationFolderName("Configuration");//folder with configuration (setup) of the detector const TString AliConfig::fgkHeaderFolderName("Header");//folder with header and other MC information -//Tasks names, goes into fgkTasksFolderName folder -const TString AliConfig::fgkDigitizerTaskName("Digitizer"); -const TString AliConfig::fgkSDigitizerTaskName("SDigitizer"); -const TString AliConfig::fgkReconstructionerTaskName("Reconstructioner"); -const TString AliConfig::fgkTrackerTaskName("Tracker"); -const TString AliConfig::fgkPIDTaskName("PIDTask");//;=) PIDer??? -const TString AliConfig::fgkQATaskName("QAtask"); - //3rd level folder //fgkConditionsFolderName subfolders const TString AliConfig::fgkCalibrationFolderName("Calibration"); const TString AliConfig::fgkAligmentFolderName("Aligment"); -const TString AliConfig::fgkQAFolderName("QAout"); //3rd level folder //fgkConfigurationFolderName subfolders @@ -123,9 +100,7 @@ AliConfig* AliConfig::Instance () AliConfig::AliConfig(const char *name, const char *title): TNamed(name,title), fTopFolder(gROOT->GetRootFolder()->AddFolder(name,title)), - fTaskFolder(fTopFolder->AddFolder(fgkTasksFolderName, "ALICE Tasks")), fConstFolder(0x0), - fDetectorTask(0x0), fDetectorFolder(new TString[kDetFolderLast+1]) { // Constructor @@ -141,7 +116,6 @@ AliConfig::AliConfig(const char *name, const char *title): fDetectorFolder[kDetFolderData] = fgkDataFolderName; fDetectorFolder[kDetFolderCalibration] = fgkConditionsFolderName+"/"+fgkCalibrationFolderName; fDetectorFolder[kDetFolderAligmnet] = fgkConditionsFolderName+"/"+fgkAligmentFolderName; - fDetectorFolder[kDetFolderQA] = fgkConditionsFolderName+"/"+fgkQAFolderName; fDetectorFolder[kDetFolderLast] = ""; gROOT->GetListOfBrowsables()->Add(fTopFolder, name); @@ -150,30 +124,6 @@ AliConfig::AliConfig(const char *name, const char *title): fConstFolder = fTopFolder->AddFolder (fgkConstantsFolderName, "Constant parameters"); fConstFolder->AddFolder("DatabasePDG", "PDG database"); - // Add the tasks to //Folders - - TTask * qa = new TTask(fgkQATaskName, "Alice QA tasks"); - fTaskFolder->Add(qa); - TTask * sd = new TTask(fgkSDigitizerTaskName, "Alice SDigitizer") ; - fTaskFolder->Add(sd); - TTask * di = new TTask(fgkDigitizerTaskName, "Alice Digitizer") ; - fTaskFolder->Add(di); - TTask * re = new TTask(fgkReconstructionerTaskName, "Alice Reconstructioner") ; - fTaskFolder->Add(re); - TTask * tr = new TTask(fgkTrackerTaskName,"Alice Tracker"); - fTaskFolder->Add(tr); - TTask * pid = new TTask(fgkPIDTaskName,"Alice Particle Identification Task"); - fTaskFolder->Add(pid); - fDetectorTask = new TString[kDetTaskLast+1]; - - fDetectorTask[kDetTaskQA] = fgkQATaskName; - fDetectorTask[kDetTaskSDigitizer] = fgkSDigitizerTaskName; - fDetectorTask[kDetTaskDigitizer] = fgkDigitizerTaskName; - fDetectorTask[kDetTaskRecontructioner] = fgkReconstructionerTaskName; - fDetectorTask[kDetTaskTracker] = fgkTrackerTaskName; - fDetectorTask[kDetTaskPID] = fgkPIDTaskName; - fDetectorTask[kDetTaskLast] = ""; - fgInstance=this; } @@ -182,7 +132,6 @@ AliConfig::~AliConfig() { // destructor delete [] fDetectorFolder ; - delete [] fDetectorTask; if (fTopFolder) { fTopFolder->SetOwner(); @@ -198,37 +147,6 @@ void AliConfig::AddInFolder (const char *dir, TObject *obj) if (folder) folder->Add (static_cast(obj)); } -//____________________________________________________________________________ - -Int_t AliConfig::AddSubTask(const char *taskname, const char* name,const char* title) -{ -//Create new task named 'name' and titled 'title' -//as a subtask of the task named 'taskname' - - AliDebug(1, Form("Try to get folder named %s",taskname)); - TObject* obj = fTopFolder->FindObject(taskname); - TTask * task = (obj)?dynamic_cast(obj):0x0; - if (task) - { - AliDebug(1, " Got"); - TTask * subtask = static_cast(task->GetListOfTasks()->FindObject(name)); - if (!subtask) - { - subtask = new TTask(name,title); - task->Add(subtask); - } - else - { - AliWarning(Form("Task named \"%s\" already exists in Task %s",name,taskname)); - } - } - else - { - AliError(Form("Can not find task %s to put a new task in.",taskname)); - return 1; - } - return 0; -} //____________________________________________________________________________ TObject* AliConfig::FindInFolder (const char *dir, const char *name) @@ -279,7 +197,7 @@ void AliConfig::Add(AliModule* obj,const char* eventfolder) Int_t AliConfig::AddDetector(TFolder* evntfolder, const char *name, const char* title) { -//creates folders and tasks for the detector 'name' +//creates folders for the detector 'name' Int_t retval;//returned value retval = CreateDetectorFolders(evntfolder,name,title); if (retval) @@ -293,7 +211,7 @@ Int_t AliConfig::AddDetector(TFolder* evntfolder, const char *name, const char* Int_t AliConfig::AddDetector(const char* evntfoldername,const char *name, const char* title) { -//creates folders and tasks for the detector 'name' +//creates folders for the detector 'name' Int_t retval;//returned value retval = CreateDetectorFolders(evntfoldername,name,title); if (retval) @@ -301,12 +219,6 @@ Int_t AliConfig::AddDetector(const char* evntfoldername,const char *name, const AliError(Form("CreateDetectorFolders returned error for detector %s",name)); return retval; } -// retval = CreateDetectorTasks(name,title); -// if (retval) -// { -// Error("AddDetector","CreateDetectorTasks returned error for detector %s",name); -// return retval; -// } return 0; } //____________________________________________________________________________ @@ -326,8 +238,6 @@ void AliConfig::Add(AliDetector * obj,const char* eventfolder) } CreateDetectorFolders(evfolder, obj->GetName(), obj->GetTitle()); -// CreateDetectorTasks(obj->GetName(),obj->GetTitle()); - } //____________________________________________________________________________ @@ -369,26 +279,6 @@ Int_t AliConfig::CreateDetectorFolders(TFolder* evntfolder,const char *name, co } return 0; } -//____________________________________________________________________________ -Int_t AliConfig::CreateDetectorTasks(const char *name, const char* title) -{ - // Creates new detector's task "name" - Int_t i = 0; - Int_t tmp; - while (i < kDetTaskLast) - { - tmp = AddSubTask(fgkTasksFolderName+"/"+fDetectorTask[i], - name+fDetectorTask[i],(fDetectorTask[i]+" for ")+title); - if (tmp) - { - AliError(Form("Error occured while creating task for %s in %s.", - name,fDetectorTask[i-1].Data())); - return 1; - } - i++; - } - return 0; -} /*****************************************************************************/ @@ -396,9 +286,7 @@ TFolder* AliConfig::BuildEventFolder(const char* name,const char* title) { /* creates the folder structure for one event - TopFolder_ - | \ - | Tasks + TopFolder |_ | \ | Constants @@ -510,7 +398,6 @@ TFolder* AliConfig::BuildEventFolder(const char* name,const char* title) TFolder *conditions = eventfolder->AddFolder(fgkConditionsFolderName, "Run conditions"); conditions->AddFolder(fgkCalibrationFolderName,"Detector calibration data"); conditions->AddFolder(fgkAligmentFolderName,"Detector aligment"); - conditions->AddFolder(fgkQAFolderName,"Quality Asurance Output"); //Folder with output of the QA task(s) //Configuration TFolder *configuration = eventfolder->AddFolder(fgkConfigurationFolderName, "Run configuration"); configuration->AddFolder(fgkFieldFolderName, "Magnetic field maps"); @@ -526,60 +413,12 @@ TFolder* AliConfig::BuildEventFolder(const char* name,const char* title) /*****************************************************************************/ -TString AliConfig::GetQATaskName() const - { - //returns task name - return fDetectorTask[kDetTaskQA]; - } -/*****************************************************************************/ - -TString AliConfig::GetDigitizerTaskName() const - { - //returns task name - return fDetectorTask[kDetTaskDigitizer]; - } -/*****************************************************************************/ - -TString AliConfig::GetSDigitizerTaskName() const - { - //returns task name - return fDetectorTask[kDetTaskSDigitizer]; - } -/*****************************************************************************/ - -TString AliConfig::GetReconstructionerTaskName() const - { - //returns task name - return fDetectorTask[kDetTaskRecontructioner]; - } -/*****************************************************************************/ - -TString AliConfig::GetTrackerTaskName() const - { - //returns task name - return fDetectorTask[kDetTaskTracker]; - } -/*****************************************************************************/ - -TString AliConfig::GetPIDTaskName() const - { - //returns task name - return fDetectorTask[kDetTaskPID]; - } -/*****************************************************************************/ - -const TString& AliConfig::GetQAFolderName() const -{ -//returns pathname of folder with QA output relative to Top Alice Folder - return fDetectorFolder[kDetFolderQA]; -} -/*****************************************************************************/ - const TString& AliConfig::GetDataFolderName() const { //returns name of data folder path relative to event folder return fgkDataFolderName; } + /*****************************************************************************/ Int_t AliConfig::AddSubFolder(TFolder* topfolder, const char* infoler, diff --git a/STEER/STEER/AliConfig.h b/STEER/STEER/AliConfig.h index 693916a0a88..3a747d8ba0b 100644 --- a/STEER/STEER/AliConfig.h +++ b/STEER/STEER/AliConfig.h @@ -27,7 +27,6 @@ class AliConfig; class AliDetector; class AliGenerator; class AliModule; -class AliTasks; class AliConfig : public TNamed { @@ -47,31 +46,18 @@ public: Int_t CreateDetectorFolders(const char* evntfoldername,const char *name, const char* title);//Used by AliRunGetter Int_t CreateDetectorFolders(TFolder* evntfolder,const char *name, const char* title);//Used by AliRunGetter - Int_t CreateDetectorTasks(const char *name, const char* title); static AliConfig* Instance(); TFolder* BuildEventFolder(const char* name,const char* tilte); TFolder* GetTopFolder(){return fTopFolder;} - TFolder* GetTaskFolder(){return fTaskFolder;} TFolder* GetConstFolder(){return fConstFolder;} static const TString& GetModulesFolderName(){return fgkModuleFolderName;} static const TString& GetDefaultEventFolderName() {return fgkDefaultEventFolderName;} - static const TString& GetTasksFolderName() {return fgkTasksFolderName;} - - TString GetQATaskName() const; //returns path to QA tasks - TString GetDigitizerTaskName () const; - TString GetSDigitizerTaskName () const; - TString GetReconstructionerTaskName () const; - TString GetTrackerTaskName () const; - TString GetPIDTaskName () const; - - - const TString& GetQAFolderName() const; //returns path to folder with QA output - + const TString& GetDataFolderName() const;//returns name of data folder private: @@ -83,39 +69,27 @@ private: static const TString fgkTopFolderName; //name of top AliRoot folder static const TString fgkDefaultEventFolderName; //name of event folder - static const TString fgkTasksFolderName; //name of task folder static const TString fgkConstantsFolderName; //name of constants folder static const TString fgkDataFolderName; //name of data folde static const TString fgkConditionsFolderName; //name of conditions folder static const TString fgkConfigurationFolderName;//name of configuration foolder static const TString fgkHeaderFolderName; //name of header folder - - static const TString fgkDigitizerTaskName; //name of digitizer task - static const TString fgkSDigitizerTaskName; //name of sdigitizer task - static const TString fgkQATaskName; //name of Q-A task - static const TString fgkReconstructionerTaskName;//name of reconstructioner - //task - static const TString fgkTrackerTaskName; //name of tracker task - static const TString fgkPIDTaskName; //name of PID task - + static const TString fgkCalibrationFolderName; //name of calibration folder static const TString fgkAligmentFolderName; //name of alignment folder - static const TString fgkQAFolderName; //name of QA folder static const TString fgkFieldFolderName; //name of magn.field folder static const TString fgkGeneratorsFolderName; //name of generator folder static const TString fgkVirtualMCFolderName; //name of virtual MC folder void AddInFolder (const char * dir, TObject *obj); - Int_t AddSubTask(const char *taskname, const char* name, const char* title); Int_t AddSubFolder(TFolder* topfolder, const char* infoler, //helper method const char* newfoldname, const char* newfoldtitle); TObject* FindInFolder (const char *dir, const char *name); // folders TFolder* fTopFolder; //pointer to top folder - TFolder* fTaskFolder; //pointer to task folder TFolder* fConstFolder; //pointer to constants folder static const TString fgkPDGFolderName; //name of PDG folder @@ -123,13 +97,12 @@ private: static const TString fgkMCFolderName; //name of MC folder static const TString fgkModuleFolderName; //name of module folder - TString *fDetectorTask;//!array with names for detector tasks TString *fDetectorFolder;//!array with names for detector folders (where detector is going to be put) static AliConfig* fgInstance; //pointer to the AliConfig instance - ClassDef(AliConfig,2) //Configuration class for AliRun + ClassDef(AliConfig,3) //Configuration class for AliRun }; // end class AliConfig #endif diff --git a/STEER/STEER/AliDataLoader.cxx b/STEER/STEER/AliDataLoader.cxx index 9de83860dfb..39c22307590 100644 --- a/STEER/STEER/AliDataLoader.cxx +++ b/STEER/STEER/AliDataLoader.cxx @@ -11,13 +11,9 @@ // Data managed by these standard base loaders has fixed naming convention // // e.g. - tree with hits is always named TreeH // // (defined in AliLoader::fgkDefaultHitsContainerName) // -// - task DtectorName+Name defined // // // // EStdBasicLoaders idx Object Type Description // // kData 0 TTree or TObject main data itself (hits,digits,...) // -// kTask 1 TTask object producing main data // -// kQA 2 TTree quality assurance tree // -// kQATask 3 TTask task producing QA object // // // // // // User can define and add more basic loaders even Run Time. // @@ -33,7 +29,6 @@ #include "AliLoader.h" #include "AliObjectLoader.h" #include "AliTreeLoader.h" -#include "AliTaskLoader.h" #include "AliLog.h" #include @@ -52,9 +47,6 @@ AliDataLoader::AliDataLoader(): fCompressionLevel(2), fNEventsPerFile(0), fBaseLoaders(0x0), - fHasTask(kFALSE), - fTaskName(), - fParentalTask(0x0), fEventFolder(0x0), fFolder(0x0) { @@ -72,9 +64,6 @@ AliDataLoader::AliDataLoader(const char* filename, const char* contname, fCompressionLevel(2), fNEventsPerFile(0), fBaseLoaders(new TObjArray(4)), - fHasTask(kFALSE), - fTaskName(), - fParentalTask(0x0), fEventFolder(0x0), fFolder(0x0) { @@ -275,7 +264,7 @@ void AliDataLoader::Unload() void AliDataLoader::UnloadAll() { // - // Unloads all data and tasks + // Unloads all data // if ( fFile == 0x0 ) return; //nothing loaded @@ -457,7 +446,7 @@ void AliDataLoader::Clean() void AliDataLoader::CleanAll() { // - // Cleans all folders and tasks + // Cleans all folders // TIter next(fBaseLoaders); AliBaseLoader* bl; @@ -595,10 +584,9 @@ Bool_t AliDataLoader::IsOptionContrary(const TString& option) const void AliDataLoader::AddBaseLoader(AliBaseLoader* bl) { //Adds a base loader to lits of base loaders managed by this data loader - //Managed data/task will be stored in proper root directory, + //Managed data will be stored in proper root directory, //and posted to // - in case of tree/object - data folder connected with detector associated with this data loader - // - in case of task - parental task which defined in this AliTaskLoader if (bl == 0x0) { @@ -671,33 +659,6 @@ AliObjectLoader* AliDataLoader::GetBaseDataLoader() return dynamic_cast(GetBaseLoader(kData)); } -//______________________________________________________________________________ -AliTaskLoader* AliDataLoader::GetBaseTaskLoader() -{ - // - // Gets the base task loader - // - return dynamic_cast(GetBaseLoader(kTask)); -} - -//______________________________________________________________________________ -AliBaseLoader* AliDataLoader::GetBaseQALoader() -{ - // - // Gets the base QA loader - // - return GetBaseLoader(kQA); -} - -//______________________________________________________________________________ -AliTaskLoader* AliDataLoader::GetBaseQATaskLoader() -{ - // - // Returns pointer to QA base loader - // - return dynamic_cast(GetBaseLoader(kQATask)); -} - //______________________________________________________________________________ void AliDataLoader::SetBaseDataLoader(AliBaseLoader* bl) { @@ -713,51 +674,6 @@ void AliDataLoader::SetBaseDataLoader(AliBaseLoader* bl) fBaseLoaders->AddAt(bl,kData); } -//______________________________________________________________________________ -void AliDataLoader::SetBaseTaskLoader(AliTaskLoader* bl) -{ - // - // Sets Task base loader - // - if (bl == 0x0) - { - AliError("Parameter is null"); - return; - } - if (GetBaseTaskLoader()) delete GetBaseTaskLoader(); - fBaseLoaders->AddAt(bl,kTask); -} - -//______________________________________________________________________________ -void AliDataLoader::SetBaseQALoader(AliBaseLoader* bl) -{ - // - // Sets QA base loader - // - if (bl == 0x0) - { - AliError("Parameter is null"); - return; - } - if (GetBaseQALoader()) delete GetBaseQALoader(); - fBaseLoaders->AddAt(bl,kQA); -} - -//______________________________________________________________________________ -void AliDataLoader::SetBaseQATaskLoader(AliTaskLoader* bl) -{ - // - // Sets QA Task base loader - // - if (bl == 0x0) - { - AliError("Parameter is null"); - return; - } - if (GetBaseQATaskLoader()) delete GetBaseQATaskLoader(); - fBaseLoaders->AddAt(bl,kQATask); -} - //______________________________________________________________________________ void AliDataLoader::Synchronize() { diff --git a/STEER/STEER/AliDataLoader.h b/STEER/STEER/AliDataLoader.h index 03d7d7e46fe..e589018503e 100644 --- a/STEER/STEER/AliDataLoader.h +++ b/STEER/STEER/AliDataLoader.h @@ -14,14 +14,10 @@ // i.e. Hits, Kine, etc. // // many objects type can be assciated // // with one data type: storing object // -// (usually tree), task producing it, // -// Quality Assurance(QA), QA Task, and // -// others. // -// // +// (usually tree) // // // //////////////////////////////////////////// -class TTask; class TTree; class TFile; class TFolder; @@ -29,7 +25,6 @@ class TFolder; class AliBaseLoader; class AliObjectLoader; class AliRunLoader; -class AliTaskLoader; #include #include @@ -85,19 +80,13 @@ class AliDataLoader: public TNamed void SetDirName(TString& dirname); void AddBaseLoader(AliBaseLoader* bl); - enum EStdBasicLoaders {kData = 0,kTask,kQA,kQATask};//standard basic loaders identifiers + enum EStdBasicLoaders {kData = 0};//standard basic loaders identifiers AliBaseLoader* GetBaseLoader(const TString& name) const; AliBaseLoader* GetBaseLoader(Int_t n) const; AliObjectLoader* GetBaseDataLoader(); - AliTaskLoader* GetBaseTaskLoader(); - AliBaseLoader* GetBaseQALoader(); - AliTaskLoader* GetBaseQATaskLoader(); void SetBaseDataLoader(AliBaseLoader* bl); - void SetBaseTaskLoader(AliTaskLoader* bl); - void SetBaseQALoader(AliBaseLoader* bl); - void SetBaseQATaskLoader(AliTaskLoader* bl); Bool_t CheckReload();//checks if we have to reload given file Bool_t IsFileWritable() const; @@ -121,14 +110,11 @@ class AliDataLoader: public TNamed Int_t fNEventsPerFile; //defines number of events stored per one file TObjArray* fBaseLoaders;//base loaders - Bool_t fHasTask;// flag if has a task - TString fTaskName;// name of the task - TTask* fParentalTask;//Parental task TFolder* fEventFolder;//!event folder TFolder* fFolder;//! folder with data - ClassDef(AliDataLoader,2) + ClassDef(AliDataLoader,3) }; #endif diff --git a/STEER/STEER/AliRunDigitizer.cxx b/STEER/STEER/AliDigitizationInput.cxx similarity index 79% rename from STEER/STEER/AliRunDigitizer.cxx rename to STEER/STEER/AliDigitizationInput.cxx index 9f715741a2f..ebf739b2ffc 100644 --- a/STEER/STEER/AliRunDigitizer.cxx +++ b/STEER/STEER/AliDigitizationInput.cxx @@ -17,7 +17,10 @@ //_______________________________________________________________________ // -// AliRunDigitizer.cxx +// AliDigitizationInput.cxx +// RS: Created from former AliDigitizationInput. It does not anymore manage digitization: +// (now it is steared by the AliSimulation) but just provides input info for +// AliDetector::SDigits2Ditits. // // Manager object for merging/digitization // @@ -25,8 +28,8 @@ // Sdigits into Digits. // // Only one instance of this class is created in the macro: -// AliRunDigitizer * manager = -// new AliRunDigitizer(nInputStreams,SPERB); +// AliDigitizationInput * manager = +// new AliDigitizationInput(nInputStreams,SPERB); // where nInputStreams is number of input streams and SPERB is // signals per background variable, which determines how combinations // of signal and background events are generated. @@ -59,7 +62,7 @@ // // Example with MUON digitizer, no merging, just digitization // -// AliRunDigitizer * manager = new AliRunDigitizer(1,1); +// AliDigitizationInput * manager = new AliDigitizationInput(1,1); // manager->SetInputStream(0,"galice.root"); // AliMUONDigitizer *dMUON = new AliMUONDigitizer(manager); // manager->Exec(""); @@ -69,7 +72,7 @@ // (background) file. Number of merged events is // min(number of events in galice.root, number of events in bgr.root) // -// AliRunDigitizer * manager = new AliRunDigitizer(2,1); +// AliDigitizationInput * manager = new AliDigitizationInput(2,1); // manager->SetInputStream(0,"galice.root"); // manager->SetInputStream(1,"bgr.root"); // AliMUONDigitizer *dMUON = new AliMUONDigitizer(manager); @@ -78,7 +81,7 @@ // Example with MUON digitizer, save digits in a new file digits.root, // process only 1 event // -// AliRunDigitizer * manager = new AliRunDigitizer(2,1); +// AliDigitizationInput * manager = new AliDigitizationInput(2,1); // manager->SetInputStream(0,"galice.root"); // manager->SetInputStream(1,"bgr.root"); // manager->SetOutputFile("digits.root"); @@ -104,17 +107,17 @@ class TList; #include "AliLoader.h" #include "AliMergeCombi.h" #include "AliRun.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliRunLoader.h" -ClassImp(AliRunDigitizer) +ClassImp(AliDigitizationInput) -const TString AliRunDigitizer::fgkDefOutFolderName("Output"); -const TString AliRunDigitizer::fgkBaseInFolderName("Input"); +const TString AliDigitizationInput::fgkDefOutFolderName("Output"); +const TString AliDigitizationInput::fgkBaseInFolderName("Input"); //_______________________________________________________________________ -AliRunDigitizer::AliRunDigitizer(): TTask("AliRunDigitizer","The manager for Merging"), +AliDigitizationInput::AliDigitizationInput(): TNamed("AliDigitizationInput","The manager for Merging"), fkMASKSTEP(0), fOutputFileName(0), fOutputDirName(0), @@ -124,6 +127,7 @@ AliRunDigitizer::AliRunDigitizer(): TTask("AliRunDigitizer","The manager for Mer fCopyTreesFromInput(0), fNinputs(0), fNinputsGiven(0), + fRegionOfInterest(kFALSE), fInputStreams(0x0), fOutRunLoader(0x0), fOutputInitialized(kFALSE), @@ -138,8 +142,8 @@ AliRunDigitizer::AliRunDigitizer(): TTask("AliRunDigitizer","The manager for Mer } //_______________________________________________________________________ -AliRunDigitizer::AliRunDigitizer(Int_t nInputStreams, Int_t sperb): - TTask("AliRunDigitizer","The manager for Merging"), +AliDigitizationInput::AliDigitizationInput(Int_t nInputStreams, Int_t sperb): + TNamed("AliDigitizationInput","The manager for Merging"), fkMASKSTEP(10000000), fOutputFileName(""), fOutputDirName("."), @@ -149,6 +153,7 @@ AliRunDigitizer::AliRunDigitizer(Int_t nInputStreams, Int_t sperb): fCopyTreesFromInput(-1), fNinputs(nInputStreams), fNinputsGiven(0), + fRegionOfInterest(kFALSE), fInputStreams(new TClonesArray("AliStream",nInputStreams)), fOutRunLoader(0x0), fOutputInitialized(kFALSE), @@ -184,7 +189,7 @@ AliRunDigitizer::AliRunDigitizer(Int_t nInputStreams, Int_t sperb): } //_______________________________________________________________________ -void AliRunDigitizer::Copy(TObject&) const +void AliDigitizationInput::Copy(TObject&) const { // // Non implemented copy function @@ -194,7 +199,7 @@ void AliRunDigitizer::Copy(TObject&) const //_______________________________________________________________________ -AliRunDigitizer::~AliRunDigitizer() +AliDigitizationInput::~AliDigitizationInput() { // // dtor @@ -203,16 +208,9 @@ AliRunDigitizer::~AliRunDigitizer() delete fCombi; delete fOutRunLoader; } + //_______________________________________________________________________ -void AliRunDigitizer::AddDigitizer(AliDigitizer *digitizer) -{ - // - // add digitizer to the list of active digitizers - // - this->Add(digitizer); -} -//_______________________________________________________________________ -void AliRunDigitizer::SetInputStream(Int_t i, const char *inputFile, TString foldername) +void AliDigitizationInput::SetInputStream(Int_t i, const char *inputFile, TString foldername) { // // Sets the name of the input file @@ -231,46 +229,7 @@ void AliRunDigitizer::SetInputStream(Int_t i, const char *inputFile, TString fol } //_______________________________________________________________________ -void AliRunDigitizer::Digitize(Option_t* option) -{ -// get a new combination of inputs, loads events to folders - -// take gAlice from the first input file. It is needed to access -// geometry data -// If gAlice is already in memory, use it - - if (!static_cast(fInputStreams->At(0))->ImportgAlice()) - { - AliError("Error occured while getting gAlice from Input 0"); - return; - } - - if (!InitGlobal()) //calls Init() for all (sub)digitizers - { - AliError("InitGlobal returned error"); - return; - } - - Int_t eventsCreated = 0; -// loop until there is anything on the input in case fNrOfEventsToWrite < 0 - while ((eventsCreated++ < fNrOfEventsToWrite) || (fNrOfEventsToWrite < 0)) - { - if (!ConnectInputTrees()) break; - InitEvent();//this must be after call of Connect Input tress. - if (fOutRunLoader) - { - fOutRunLoader->SetEventNumber(eventsCreated-1); - } - static_cast(fInputStreams->At(0))->ImportgAlice(); // use gAlice of the first input stream - ExecuteTasks(option);// loop over all registered digitizers and let them do the work - FinishEvent(); - CleanTasks(); - } - FinishGlobal(); -} - -//_______________________________________________________________________ -Bool_t AliRunDigitizer::ConnectInputTrees() +Bool_t AliDigitizationInput::ConnectInputTrees() { // // loads events @@ -294,26 +253,10 @@ Bool_t AliRunDigitizer::ConnectInputTrees() return kTRUE; } -//_______________________________________________________________________ -Bool_t AliRunDigitizer::InitGlobal() -{ - // - // Method called once before Digitize() is called - // initialize digitizers and output - // - fOutputInitialized = kFALSE; - TList* subTasks = this->GetListOfTasks(); - if (subTasks) { - TIter next(subTasks); - while (AliDigitizer * dig = (AliDigitizer *) next()) - dig->Init(); - } - return kTRUE; -} //_______________________________________________________________________ -void AliRunDigitizer::SetOutputFile(TString fn) +void AliDigitizationInput::SetOutputFile(TString fn) { // // The output will be to separate file, @@ -326,7 +269,7 @@ void AliRunDigitizer::SetOutputFile(TString fn) } //_______________________________________________________________________ -Bool_t AliRunDigitizer::InitOutputGlobal() +Bool_t AliDigitizationInput::InitOutputGlobal() { // // Creates the output file, called by InitEvent() @@ -372,7 +315,7 @@ Bool_t AliRunDigitizer::InitOutputGlobal() } //_______________________________________________________________________ -void AliRunDigitizer::InitEvent() +void AliDigitizationInput::InitEvent() { // // redirects output properly @@ -385,7 +328,7 @@ void AliRunDigitizer::InitEvent() } //_______________________________________________________________________ -void AliRunDigitizer::FinishEvent() +void AliDigitizationInput::FinishEvent() { // // called at the end of loop over digitizers @@ -430,7 +373,7 @@ void AliRunDigitizer::FinishEvent() } //_______________________________________________________________________ -void AliRunDigitizer::FinishGlobal() +void AliDigitizationInput::FinishGlobal() { // // called at the end of Exec @@ -466,7 +409,7 @@ void AliRunDigitizer::FinishGlobal() } //_______________________________________________________________________ -Int_t AliRunDigitizer::GetNParticles(Int_t event) const +Int_t AliDigitizationInput::GetNParticles(Int_t event) const { // return number of particles in all input files for a given // event (as numbered in the output file) @@ -483,7 +426,7 @@ Int_t AliRunDigitizer::GetNParticles(Int_t event) const } //_______________________________________________________________________ -Int_t AliRunDigitizer::GetNParticles(Int_t /*event*/, Int_t /*input*/) const +Int_t AliDigitizationInput::GetNParticles(Int_t /*event*/, Int_t /*input*/) const { // return number of particles in input file input for a given // event (as numbered in this input file) @@ -496,7 +439,7 @@ Int_t AliRunDigitizer::GetNParticles(Int_t /*event*/, Int_t /*input*/) const } //_______________________________________________________________________ -Int_t* AliRunDigitizer::GetInputEventNumbers(Int_t event) const +Int_t* AliDigitizationInput::GetInputEventNumbers(Int_t event) const { // return pointer to an int array with input event numbers which were // merged in the output event event @@ -509,7 +452,7 @@ Int_t* AliRunDigitizer::GetInputEventNumbers(Int_t event) const return a; } //_______________________________________________________________________ -Int_t AliRunDigitizer::GetInputEventNumber(Int_t event, Int_t /*input*/) const +Int_t AliDigitizationInput::GetInputEventNumber(Int_t event, Int_t /*input*/) const { // return an event number of an eventInput from input file input // which was merged to create output event event @@ -518,7 +461,7 @@ Int_t AliRunDigitizer::GetInputEventNumber(Int_t event, Int_t /*input*/) const return event; } //_______________________________________________________________________ -TParticle* AliRunDigitizer::GetParticle(Int_t i, Int_t event) const +TParticle* AliDigitizationInput::GetParticle(Int_t i, Int_t event) const { // return pointer to particle with index i (index with mask) @@ -528,7 +471,7 @@ TParticle* AliRunDigitizer::GetParticle(Int_t i, Int_t event) const } //_______________________________________________________________________ -TParticle* AliRunDigitizer::GetParticle(Int_t /*i*/, Int_t /*input*/, Int_t /*event*/) const +TParticle* AliDigitizationInput::GetParticle(Int_t /*i*/, Int_t /*input*/, Int_t /*event*/) const { // return pointer to particle with index i in the input file input // (index without mask) @@ -541,19 +484,7 @@ TParticle* AliRunDigitizer::GetParticle(Int_t /*i*/, Int_t /*input*/, Int_t /*ev } //_______________________________________________________________________ -void AliRunDigitizer::ExecuteTask(Option_t* option) -{ - // - // overwrite ExecuteTask to do Digitize only - // - if (!IsActive()) return; - Digitize(option); - fHasExecuted = kTRUE; - return; -} - -//_______________________________________________________________________ -const TString& AliRunDigitizer::GetInputFolderName(Int_t i) const +const TString& AliDigitizationInput::GetInputFolderName(Int_t i) const { // // Get the input Folder Name @@ -565,7 +496,7 @@ const TString& AliRunDigitizer::GetInputFolderName(Int_t i) const } //_______________________________________________________________________ -const char* AliRunDigitizer::GetOutputFolderName() +const char* AliDigitizationInput::GetOutputFolderName() { // // Get output folder name @@ -574,7 +505,7 @@ const char* AliRunDigitizer::GetOutputFolderName() } //_______________________________________________________________________ -AliRunLoader* AliRunDigitizer::GetOutRunLoader() +AliRunLoader* AliDigitizationInput::GetOutRunLoader() { // // Returns Run Loader @@ -591,7 +522,7 @@ AliRunLoader* AliRunDigitizer::GetOutRunLoader() } //_______________________________________________________________________ -TString AliRunDigitizer::GetInputFileName(Int_t input, Int_t order) const +TString AliDigitizationInput::GetInputFileName(Int_t input, Int_t order) const { // returns file name of the order-th file in the input stream input // returns empty string if such file does not exist diff --git a/STEER/STEER/AliRunDigitizer.h b/STEER/STEER/AliDigitizationInput.h similarity index 87% rename from STEER/STEER/AliRunDigitizer.h rename to STEER/STEER/AliDigitizationInput.h index 98409125e79..0035c638dc7 100644 --- a/STEER/STEER/AliRunDigitizer.h +++ b/STEER/STEER/AliDigitizationInput.h @@ -1,5 +1,5 @@ -#ifndef ALIRUNDIGITIZER_H -#define ALIRUNDIGITIZER_H +#ifndef ALIDIGITIZATIONINPUT_H +#define ALIDIGITIZATIONINPUT_H /* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ @@ -16,7 +16,7 @@ // --- ROOT system --- #include "TArrayI.h" -#include "TTask.h" +#include "TNamed.h" #include "TClonesArray.h" class TFile; class TParticle; @@ -31,18 +31,13 @@ class AliRunLoader; #define MAXSTREAMSTOMERGE 4 -class AliRunDigitizer: public TTask { +class AliDigitizationInput: public TNamed { public: - AliRunDigitizer(); - AliRunDigitizer(Int_t nInputStreams, Int_t sperb=1); + AliDigitizationInput(); + AliDigitizationInput(Int_t nInputStreams, Int_t sperb=1); - virtual ~AliRunDigitizer(); - - void ExecuteTask(Option_t* option = 0); - void Exec(Option_t *option) {this->Digitize(option);} - void Digitize(Option_t* option = 0); - void AddDigitizer(AliDigitizer *digitizer); + virtual ~AliDigitizationInput(); void SetOutputFile(TString fn); TString GetOutputFile() const {return fOutputFileName;} @@ -60,8 +55,8 @@ public: void SetCombinationFileName(TString fn) {fCombinationFileName = fn;} TString GetCombinationFileName() const {return fCombinationFileName;} Int_t GetMask(Int_t i) const {return fkMASK[i];} - - + void SetRegionOfInterest(Bool_t flag) {fRegionOfInterest = flag;}; + Bool_t GetRegionOfInterest() const {return fRegionOfInterest;}; Int_t GetNinputs() const {return fNinputs;} const TString& GetInputFolderName(Int_t i) const; const char* GetOutputFolderName(); @@ -94,17 +89,18 @@ public: // return TString with input file name TString GetInputFileName(Int_t input, Int_t order) const; - -private: - AliRunDigitizer(const AliRunDigitizer& dig); // not implemented - AliRunDigitizer& operator=(const AliRunDigitizer& dig); // not implemented - void Copy(TObject& dig) const; + AliRunLoader* GetOutRunLoader(); + // Bool_t ConnectInputTrees(); - Bool_t InitGlobal(); Bool_t InitOutputGlobal(); void InitEvent(); void FinishEvent(); void FinishGlobal(); + +private: + AliDigitizationInput(const AliDigitizationInput& dig); // not implemented + AliDigitizationInput& operator=(const AliDigitizationInput& dig); // not implemented + void Copy(TObject& dig) const; Int_t fkMASK[MAXSTREAMSTOMERGE]; //! masks for track ids from // different source files @@ -120,6 +116,7 @@ private: // should be copied, -1 for no copies Int_t fNinputs; // nr of input streams - can be taken from the TClonesArray dimension Int_t fNinputsGiven; // nr of input streams given by user + Bool_t fRegionOfInterest; // digitization in region of interest TClonesArray * fInputStreams; // input signal streams // AliStream* fOutputStream; @@ -129,13 +126,10 @@ private: AliMergeCombi * fCombi; // pointer to the combination object TArrayI fCombination; //! combination of events from TString fCombinationFileName; // fn with combinations (used - // with type 2 of comb.) - - AliRunLoader* GetOutRunLoader(); - + // with type 2 of comb.) static const TString fgkDefOutFolderName;//default name for output foler static const TString fgkBaseInFolderName;//default name for input foler - ClassDef(AliRunDigitizer,6) + ClassDef(AliDigitizationInput,2) }; #endif // ALIRUNDIGITIZER_H diff --git a/STEER/STEER/AliDigitizer.cxx b/STEER/STEER/AliDigitizer.cxx index a32be6e7ec4..381422f3f10 100644 --- a/STEER/STEER/AliDigitizer.cxx +++ b/STEER/STEER/AliDigitizer.cxx @@ -17,7 +17,7 @@ //---------------------------------------------------------------------- // Base Class for Detector specific Merging/Digitization -// Collaborates with AliRunDigitizer class +// Collaborates with AliDigitizationInput class // Author: Jiri Chudoba (CERN) //---------------------------------------------------------------------- @@ -29,15 +29,14 @@ // AliROOT includes #include "AliLog.h" #include "AliDigitizer.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" ClassImp(AliDigitizer) //_______________________________________________________________________ AliDigitizer::AliDigitizer(const Text_t* name, const Text_t* title): - TTask(name,title), - fManager(0), - fRegionOfInterest(kTRUE) + TNamed(name,title), + fDigInput(0) { // // Default ctor with name and title @@ -46,9 +45,8 @@ AliDigitizer::AliDigitizer(const Text_t* name, const Text_t* title): //_______________________________________________________________________ AliDigitizer::AliDigitizer(const AliDigitizer &dig): - TTask(dig.GetName(),dig.GetTitle()), - fManager(0), - fRegionOfInterest(kTRUE) + TNamed(dig.GetName(),dig.GetTitle()), + fDigInput(0) { // // Copy ctor with @@ -63,16 +61,13 @@ void AliDigitizer::Copy(TObject &) const } //_______________________________________________________________________ -AliDigitizer::AliDigitizer(AliRunDigitizer *manager, +AliDigitizer::AliDigitizer(AliDigitizationInput *digInput, const Text_t* name, const Text_t* title): - TTask(name,title), - fManager(manager), - fRegionOfInterest(kFALSE) + TNamed(name,title), + fDigInput(digInput) { // // ctor with name and title - // - fManager->AddDigitizer(this); } //_______________________________________________________________________ @@ -87,7 +82,6 @@ Int_t AliDigitizer::GetNInputStreams() const // return number of input streams // Int_t nInputStreams = 0 ; - if (fManager) - nInputStreams = fManager->GetNinputs() ; + if (fDigInput) nInputStreams = fDigInput->GetNinputs() ; return nInputStreams ; } diff --git a/STEER/STEER/AliDigitizer.h b/STEER/STEER/AliDigitizer.h index 0eaadb37bd5..4c9c9d78dc1 100644 --- a/STEER/STEER/AliDigitizer.h +++ b/STEER/STEER/AliDigitizer.h @@ -13,18 +13,17 @@ // //////////////////////////////////////////////////////////////////////// -#include "TTask.h" +#include "TNamed.h" +#include "AliDigitizationInput.h" -class AliRunDigitizer; - -class AliDigitizer: public TTask { +class AliDigitizer: public TNamed { public: // ctor with name and title AliDigitizer(const Text_t* name="AliDigitizer", const Text_t* title="AliDigitizer"); // ctor to be used with name and title - AliDigitizer(AliRunDigitizer *manager, + AliDigitizer(AliDigitizationInput *manager, const Text_t* name="AliDigitizer", const Text_t* title="AliDigitizer"); // Copy ctor needed because there is a pointer @@ -34,17 +33,16 @@ class AliDigitizer: public TTask { virtual ~AliDigitizer(); virtual Bool_t Init() {return kTRUE;} - void SetRegionOfInterest(Bool_t flag) {fRegionOfInterest = flag;}; -// virtual void Digitize() = 0; + virtual void Digitize(Option_t* option) = 0; + Bool_t GetRegionOfInterest() const {return fDigInput ? fDigInput->GetRegionOfInterest() : kFALSE;} protected: Int_t GetNInputStreams() const; void Copy(TObject &dig) const; - AliRunDigitizer *fManager; //! Pointer to the Digitizer manager - Bool_t fRegionOfInterest; // Flag for digitization only in region of interest + AliDigitizationInput *fDigInput; //! Pointer to the Digitizer input - ClassDef(AliDigitizer,2) // Base class for detector digitizers + ClassDef(AliDigitizer,3) // Base class for detector digitizers }; #endif // ALIDIGITIZER_H diff --git a/STEER/STEER/AliLoader.cxx b/STEER/STEER/AliLoader.cxx index 0ced45aa25f..a549fccaaa6 100644 --- a/STEER/STEER/AliLoader.cxx +++ b/STEER/STEER/AliLoader.cxx @@ -14,12 +14,10 @@ #include #include #include -#include //AliRoot includes #include "AliConfig.h" #include "AliDetector.h" -#include "AliDigitizer.h" #include "AliLog.h" #include "AliRun.h" #include "AliRunLoader.h" @@ -53,13 +51,11 @@ AliLoader::AliLoader(): fEventFolder(0x0), fDataFolder(0x0), fDetectorDataFolder(0x0), - fModuleFolder(0x0), - fTasksFolder(0x0), - fQAFolder(0x0) + fModuleFolder(0x0) { -//default constructor - - } + //default constructor + +} /******************************************************************/ AliLoader::AliLoader(const Char_t* detname,const Char_t* eventfoldername): @@ -68,9 +64,7 @@ AliLoader::AliLoader(const Char_t* detname,const Char_t* eventfoldername): fEventFolder(0x0), fDataFolder(0x0), fDetectorDataFolder(0x0), - fModuleFolder(0x0), - fTasksFolder(0x0), - fQAFolder(0x0) + fModuleFolder(0x0) { //ctor AliDebug(1, Form("detname = %s eventfoldername = %s",detname,eventfoldername)); @@ -95,9 +89,7 @@ AliLoader::AliLoader(const Char_t * detname,TFolder* eventfolder): fEventFolder(0x0), fDataFolder(0x0), fDetectorDataFolder(0x0), - fModuleFolder(0x0), - fTasksFolder(0x0), - fQAFolder(0x0) + fModuleFolder(0x0) { //constructor fDetectorName = detname; @@ -126,37 +118,22 @@ void AliLoader::InitDefaults() // S U M M A B L E D I G I T S dl = new AliDataLoader(fDetectorName + ".SDigits.root",fgkDefaultSDigitsContainerName, "Summable Digits"); - AliTaskLoader* tl = new AliTaskLoader(fDetectorName + AliConfig::Instance()->GetSDigitizerTaskName(), - dl,AliRunLoader::GetRunSDigitizer(),kTRUE); - dl->SetBaseTaskLoader(tl); fDataLoaders->AddAt(dl,kSDigits); // D I G I T S dl = new AliDataLoader(fDetectorName + ".Digits.root",fgkDefaultDigitsContainerName, "Digits"); - tl = new AliTaskLoader(fDetectorName + AliConfig::Instance()->GetDigitizerTaskName(), - dl,AliRunLoader::GetRunDigitizer(),kTRUE); - dl->SetBaseTaskLoader(tl); fDataLoaders->AddAt(dl,kDigits); // R E C O N S T R U C T E D P O I N T S aka C L U S T E R S dl = new AliDataLoader(fDetectorName + ".RecPoints.root",fgkDefaultRecPointsContainerName, "Reconstructed Points"); - tl = new AliTaskLoader(fDetectorName + AliConfig::Instance()->GetReconstructionerTaskName(), - dl,AliRunLoader::GetRunReconstructioner(),kTRUE); - dl->SetBaseTaskLoader(tl); fDataLoaders->AddAt(dl,kRecPoints); // T R A C K S dl = new AliDataLoader(fDetectorName + ".Tracks.root",fgkDefaultTracksContainerName, "Tracks"); - tl = new AliTaskLoader(fDetectorName + AliConfig::Instance()->GetTrackerTaskName(), - dl,AliRunLoader::GetRunTracker(),kTRUE); - dl->SetBaseTaskLoader(tl); fDataLoaders->AddAt(dl,kTracks); // R E C O N S T R U C T E D P O I N T S aka C L U S T E R S dl = new AliDataLoader(fDetectorName + ".RecParticles.root",fgkDefaultRecParticlesContainerName, "Reconstructed Particles"); - tl = new AliTaskLoader(fDetectorName + AliConfig::Instance()->GetPIDTaskName(), - dl,AliRunLoader::GetRunPIDTask(),kTRUE); - dl->SetBaseTaskLoader(tl); fDataLoaders->AddAt(dl,kRecParticles); } @@ -275,24 +252,6 @@ TFolder* AliLoader::GetDataFolder() /*****************************************************************************/ -TFolder* AliLoader::GetTasksFolder() -{ -//Returns pointer to Folder with Alice Tasks - if (!fTasksFolder) - { - fTasksFolder = dynamic_cast(GetTopFolder()->FindObject(AliConfig::GetTasksFolderName())); - - if (!fTasksFolder) - { - AliFatal("Can not find tasks folder. Aborting"); - return 0x0; - } - } - return fTasksFolder; - -} -/*****************************************************************************/ - TFolder* AliLoader::GetModulesFolder() { //returns pointer to the folder containing modules @@ -309,98 +268,7 @@ TFolder* AliLoader::GetModulesFolder() return fModuleFolder; } -/*****************************************************************************/ - -TFolder* AliLoader::GetQAFolder() -{ - //returns folder with Quality assurance - if (fQAFolder == 0x0) - { - TObject *obj = GetEventFolder()->FindObjectAny(AliConfig::Instance()->GetQAFolderName()); - fQAFolder = (obj)?dynamic_cast(obj):0x0; - if (fQAFolder == 0x0) - { - AliFatal("Can not find Quality Assurance folder. Aborting"); - return 0x0; - } - } - return fQAFolder; - -} -/*****************************************************************************/ -TTask* AliLoader::SDigitizer() const -{ -//returns SDigitizer task for this detector - return GetSDigitsDataLoader()->GetBaseTaskLoader()->Task(); - -} -/*****************************************************************************/ - -AliDigitizer* AliLoader::Digitizer() const -{ -//returns Digitizer task for this detector - return dynamic_cast(GetDigitsDataLoader()->GetBaseTaskLoader()->Task()); -} -/*****************************************************************************/ - -TTask* AliLoader::Reconstructioner() const -{ -//returns Recontructioner (Cluster Finder, Cluster Maker, -//or whatever you want to call it) task for this detector - return GetRecPointsDataLoader()->GetBaseTaskLoader()->Task(); -} -/*****************************************************************************/ - -TTask* AliLoader::Tracker() const -{ -//returns tracker - return dynamic_cast(GetTracksDataLoader()->GetBaseTaskLoader()->Task()); -} - -/*****************************************************************************/ -TTask* AliLoader::PIDTask() const -{ -//returns tracker - return dynamic_cast(GetRecParticlesDataLoader()->GetBaseTaskLoader()->Task()); -} - -/*****************************************************************************/ - -TTask* AliLoader::QAtask(const char* name) const -{ - // Returns pointer to the quality assurance task - TTask* qat = AliRunLoader::GetRunQATask(); - if ( qat == 0x0 ) - { - AliError(Form("Can not get RunQATask. (Name:%s)",GetName())); - return 0x0; - } - - TString dqatname(fDetectorName + AliConfig::Instance()->GetQATaskName()); - TTask* dqat = dynamic_cast(qat->GetListOfTasks()->FindObject(dqatname)); - - if ( dqat == 0x0 ) - { - AliError(Form("Can not find QATask in RunQATask for %s",GetDetectorName().Data())); - return 0x0; - } - - if (strlen(name) == 0) return dqat; - - TList* list = dqat->GetListOfTasks(); - - TIter it(list) ; - TTask * task = 0 ; - while((task = static_cast(it.Next()) )) - { - TString taskname(task->GetName()) ; - if(taskname.BeginsWith(name)) - return task ; - } - AliError(Form("Can not find sub-task with name starting with %s in task %s",name,dqat->GetName())); - return 0x0; -} /*****************************************************************************/ TDirectory* AliLoader::ChangeDir(TFile* file, Int_t eventno) @@ -519,41 +387,6 @@ Int_t AliLoader::WriteSDigits(Option_t* opt) const /*****************************************************************************/ -Int_t AliLoader::PostSDigitizer(TTask* sdzer) const -{ - // Posts sdigitizer - return GetSDigitsDataLoader()->GetBaseTaskLoader()->Post(sdzer); -} -/*****************************************************************************/ - -Int_t AliLoader::PostDigitizer(AliDigitizer* task) const - { - // Posts digitizer - return GetDigitsDataLoader()->GetBaseTaskLoader()->Post(task); - } -/*****************************************************************************/ - -Int_t AliLoader::PostReconstructioner(TTask* task) const - { - // Posts Reconstructioner - return GetRecPointsDataLoader()->GetBaseTaskLoader()->Post(task); - } -/*****************************************************************************/ - -Int_t AliLoader::PostTracker(TTask* task) const - { - // Posts a tracker - return GetTracksDataLoader()->GetBaseTaskLoader()->Post(task); - } -/*****************************************************************************/ - -Int_t AliLoader::PostPIDTask(TTask* task) const - { - // Posts particle identification task - return GetRecParticlesDataLoader()->GetBaseTaskLoader()->Post(task); - } -/*****************************************************************************/ - TObject** AliLoader::GetDetectorDataRef(TObject *obj) { // Returns pointer to an entry in the list of folders pointing to "obj" @@ -563,66 +396,6 @@ TObject** AliLoader::GetDetectorDataRef(TObject *obj) } return GetDetectorDataFolder()->GetListOfFolders()->GetObjectRef(obj) ; } -/*****************************************************************************/ - -TObject** AliLoader::SDigitizerRef() -{ - // Returns pointer to a Runloader's task-list entry pointing to SDigitizer - TTask* rsd = AliRunLoader::GetRunSDigitizer(); - if (rsd == 0x0) - { - return 0x0; - } - return rsd->GetListOfTasks()->GetObjectRef(SDigitizer()); -} -/*****************************************************************************/ - -TObject** AliLoader::DigitizerRef() -{ - // Returns pointer to a Runloader's task-list entry pointing to Digitizer - TTask* rd = AliRunLoader::GetRunDigitizer(); - if (rd == 0x0) - { - return 0x0; - } - return rd->GetListOfTasks()->GetObjectRef(Digitizer()) ; -} -/*****************************************************************************/ - -TObject** AliLoader::ReconstructionerRef() -{ - // Returns pointer to a Runloader's task-list entry pointing to Reconstructioner - TTask* rrec = AliRunLoader::GetRunReconstructioner(); - if (rrec == 0x0) - { - return 0x0; - } - return rrec->GetListOfTasks()->GetObjectRef(Reconstructioner()); -} -/*****************************************************************************/ - -TObject** AliLoader::TrackerRef() -{ - // Returns pointer to a Runloader's task-list entry pointing to Tracker - TTask* rrec = AliRunLoader::GetRunTracker(); - if (rrec == 0x0) - { - return 0x0; - } - return rrec->GetListOfTasks()->GetObjectRef(Tracker()); -} -/*****************************************************************************/ - -TObject** AliLoader::PIDTaskRef() -{ - // Returns pointer to a Runloader's task-list entry pointing to PIDTask - TTask* rrec = AliRunLoader::GetRunPIDTask(); - if (rrec == 0x0) - { - return 0x0; - } - return rrec->GetListOfTasks()->GetObjectRef(PIDTask()); -} /*****************************************************************************/ void AliLoader::CleanFolders() @@ -636,69 +409,7 @@ void AliLoader::CleanFolders() dl->Clean(); } } -/*****************************************************************************/ - -/*****************************************************************************/ - -void AliLoader::CleanSDigitizer() -{ -//removes and deletes detector task from Run Task - if ( GetSDigitsDataLoader()->GetBaseTaskLoader() == 0x0 ) - { - AliWarning("Task Loader for SDigits does not exist"); - return; - } - GetSDigitsDataLoader()->GetBaseTaskLoader()->Clean(); -} -/*****************************************************************************/ - -void AliLoader::CleanDigitizer() -{ -//removes and deletes detector task from Run Task - if ( GetDigitsDataLoader()->GetBaseTaskLoader() == 0x0 ) - { - AliWarning("Task Loader for Digits does not exist"); - return; - } - GetDigitsDataLoader()->GetBaseTaskLoader()->Clean(); -} -/*****************************************************************************/ - -void AliLoader::CleanReconstructioner() -{ -//removes and deletes detector Reconstructioner from Run Reconstructioner - if ( GetRecPointsDataLoader()->GetBaseTaskLoader() == 0x0 ) - { - AliWarning("Task Loader for SDigits does not exist"); - return; - } - GetRecPointsDataLoader()->GetBaseTaskLoader()->Clean(); -} -/*****************************************************************************/ - -void AliLoader::CleanTracker() -{ -//removes and deletes detector task from Run Task - if ( GetTracksDataLoader()->GetBaseTaskLoader() == 0x0 ) - { - AliWarning("Task Loader for Tracks does not exist"); - return; - } - GetTracksDataLoader()->GetBaseTaskLoader()->Clean(); -} -/*****************************************************************************/ -void AliLoader::CleanPIDTask() -{ -//removes and deletes detector Reconstructioner from Run Reconstructioner - - if ( GetRecParticlesDataLoader()->GetBaseTaskLoader() == 0x0 ) - { - AliWarning("Task Loader for Reconstructed Particles does not exist"); - return; - } - GetRecParticlesDataLoader()->GetBaseTaskLoader()->Clean(); -} /*****************************************************************************/ Int_t AliLoader::ReloadAll() @@ -773,7 +484,7 @@ Int_t AliLoader::Register(TFolder* eventFolder) Int_t retval = AliConfig::Instance()->AddDetector(eventFolder,fDetectorName,fDetectorName); if(retval) { - AliError(Form("Can not create tasks and/or folders for %s. Event folder name is %s", + AliError(Form("Can not create folders for %s. Event folder name is %s", fDetectorName.Data(),eventFolder->GetName())); return retval; } @@ -884,7 +595,6 @@ void AliLoader::SetDebug(Int_t deb) AliLog::SetClassDebugLevel("AliBaseLoader", deb); AliLog::SetClassDebugLevel("AliObjectLoader", deb); AliLog::SetClassDebugLevel("AliTreeLoader", deb); - AliLog::SetClassDebugLevel("AliTaskLoader", deb); AliLog::SetClassDebugLevel("AliConfig", deb); } /*****************************************************************************/ diff --git a/STEER/STEER/AliLoader.h b/STEER/STEER/AliLoader.h index d967bee6b28..bdc8d3e89d2 100644 --- a/STEER/STEER/AliLoader.h +++ b/STEER/STEER/AliLoader.h @@ -4,17 +4,15 @@ class TDirectory; class TFile; class TString; -class TTask; class TTree; #include #include -class AliDigitizer; class AliRunLoader; #include "AliDataLoader.h" -#include "AliTaskLoader.h" +#include "AliBaseLoader.h" //___________________________________________________________________ @@ -71,21 +69,6 @@ class AliLoader: public TNamed TFolder* GetDetectorDataFolder();//returns the folder that hits, sdigits, etc //are sitting for a given detector (subfolder of Data Folder) TFolder* GetModulesFolder(); - TFolder* GetTasksFolder(); - TFolder* GetQAFolder(); - - TTask* SDigitizer() const;//return detector SDigitizer() - AliDigitizer* Digitizer() const; - TTask* Reconstructioner() const; - TTask* Tracker() const; - TTask* PIDTask() const; - TTask* QAtask(const char* name = 0x0) const; - - TObject** SDigitizerRef(); - TObject** DigitizerRef(); - TObject** ReconstructionerRef(); - TObject** TrackerRef(); - TObject** PIDTaskRef(); virtual void MakeHitsContainer() const {GetHitsDataLoader()->MakeTree();} virtual void MakeSDigitsContainer() const {GetSDigitsDataLoader()->MakeTree();} @@ -97,23 +80,6 @@ class AliLoader: public TNamed virtual void CleanFolders(); virtual void CloseFiles(); - virtual Int_t PostSDigitizer(TTask* sdzer) const;//adds it to Run SDigitizer - virtual Int_t PostDigitizer(AliDigitizer* task) const; - virtual Int_t PostReconstructioner(TTask* task) const; - virtual Int_t PostTracker(TTask* task) const; - virtual Int_t PostPIDTask(TTask* task) const; - - virtual Int_t WriteSDigitizer(Option_t* opt="") const - {return GetSDigitsDataLoader()->GetBaseTaskLoader()->WriteData(opt);} - virtual Int_t WriteDigitizer(Option_t* opt="") const - {return GetDigitsDataLoader()->GetBaseTaskLoader()->WriteData(opt);} - virtual Int_t WriteReconstructioner(Option_t* opt="") const - {return GetRecPointsDataLoader()->GetBaseTaskLoader()->WriteData(opt);} - virtual Int_t WriteTracker(Option_t* opt="") const - {return GetTracksDataLoader()->GetBaseTaskLoader()->WriteData(opt);} - virtual Int_t WritePIDTask(Option_t* opt="") const - {return GetRecParticlesDataLoader()->GetBaseTaskLoader()->WriteData(opt);} - TTree* TreeH() const {return GetHitsDataLoader()->Tree();} //returns the tree from folder; shortcut method TTree* TreeS() const @@ -159,22 +125,6 @@ class AliLoader: public TNamed SetTAddrInDet(); return status; } - - Int_t LoadSDigitizer(Option_t* opt="") const { - return GetSDigitsDataLoader()->GetBaseTaskLoader()->Load(opt); - } - Int_t LoadDigitizer(Option_t* opt="") const { - return GetDigitsDataLoader()->GetBaseTaskLoader()->Load(opt); - } - Int_t LoadReconstructioner(Option_t* opt="") const { - return GetRecPointsDataLoader()->GetBaseTaskLoader()->Load(opt); - } - Int_t LoadTracker(Option_t* opt="") const { - return GetTracksDataLoader()->GetBaseTaskLoader()->Load(opt); - } - Int_t LoadPIDTask(Option_t* opt="") const { - return GetRecParticlesDataLoader()->GetBaseTaskLoader()->Load(opt); - } void UnloadHits() const {GetHitsDataLoader()->Unload();} void UnloadSDigits() const {GetSDigitsDataLoader()->Unload();} @@ -239,12 +189,6 @@ class AliLoader: public TNamed {GetRecPointsDataLoader()->Clean();} //cleans rec. points from folder virtual void CleanTracks() const {GetTracksDataLoader()->Clean();} //cleans tracks from folder - - virtual void CleanSDigitizer(); //cleans SDigitizer from folder - virtual void CleanDigitizer(); //cleans Digitizer from folder - virtual void CleanReconstructioner(); //cleans Reconstructions (clusterizer) from folder - virtual void CleanTracker(); //cleans tracker from folder - virtual void CleanPIDTask(); //cleans Reconstructions (clusterizer) from folder virtual void SetHitsFileOption(Option_t* newopt) const {GetHitsDataLoader()->SetFileOption(newopt);} //Sets Hits File Option in open @@ -351,9 +295,6 @@ class AliLoader: public TNamed TFolder* fDetectorDataFolder;//!Folder that contains the detector data TFolder* fModuleFolder; //!Folder that contains the modules - TFolder* fTasksFolder; //!Folder that contains the Tasks (sdigitizer, digitizer, reconstructioner) - TFolder* fQAFolder; //!Folder that contains the QA objects - // file option varible was introduced because if TFile is created with "recreate" // stored option in TFile is "CREATE". We need to remeber "recreate" for // Max events per file functionality @@ -372,7 +313,7 @@ class AliLoader: public TNamed AliLoader(const AliLoader&); //Not implemented AliLoader& operator=(const AliLoader&); //Not implemented - ClassDef(AliLoader,2) + ClassDef(AliLoader,3) }; /******************************************************************/ /************************ I N L I N E S ***************************/ diff --git a/STEER/STEER/AliModule.cxx b/STEER/STEER/AliModule.cxx index 5974f7ab08f..b7dc2dca805 100644 --- a/STEER/STEER/AliModule.cxx +++ b/STEER/STEER/AliModule.cxx @@ -52,6 +52,7 @@ #include "AliMC.h" #include "AliSimulation.h" #include "AliRawDataHeader.h" +#include "AliDigitizationInput.h" #include "AliDAQ.h" @@ -69,7 +70,8 @@ AliModule::AliModule(): fEnable(1), fMaxIterTrackRef(0), fCurrentIterTrackRef(0), - fRunLoader(0) + fRunLoader(0), + fDigInput(0) { // // Default constructor for the AliModule class @@ -87,7 +89,8 @@ AliModule::AliModule(const char* name,const char *title): fEnable(1), fMaxIterTrackRef(0), fCurrentIterTrackRef(0), - fRunLoader(0) + fRunLoader(0), + fDigInput(0) { // // Normal constructor invoked by all Modules. diff --git a/STEER/STEER/AliModule.h b/STEER/STEER/AliModule.h index 5fced4f3b8d..adccc8c32cd 100644 --- a/STEER/STEER/AliModule.h +++ b/STEER/STEER/AliModule.h @@ -26,7 +26,7 @@ class TTree; class AliLoader; class AliTrackReference; class AliDigitizer; -class AliRunDigitizer; +class AliDigitizationInput; class AliVertexer; class AliTracker; class AliESD; @@ -88,7 +88,7 @@ public: virtual void AddHit(Int_t, Int_t*, Float_t *) { Error("AddDigit","Hits cannot be added to module %s\n",fName.Data());} virtual void Hits2SDigits() {} - virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* /*manager*/) const + virtual AliDigitizer* CreateDigitizer(AliDigitizationInput* /*manager*/) const {return NULL;} virtual AliTriggerDetector* CreateTriggerDetector() const { AliTriggerDetector* det = new AliTriggerDetector(); det->SetName(GetName()); return det;} @@ -142,7 +142,8 @@ public: // Quality Assurance methods virtual void CheckQA() { ; } - + AliDigitizationInput* GetDigitizationInput() const {return fDigInput;} + // static void SetDensityFactor(Float_t density) { fgDensityFactor = density; } static Float_t GetDensityFactor() { return fgDensityFactor; } @@ -161,13 +162,12 @@ protected: Int_t fCurrentIterTrackRef; //!for track refernce iterator routines AliRunLoader* fRunLoader; //!local pointer to run loader - + AliDigitizationInput* fDigInput; //! input for sdigits -> digits static Float_t fgDensityFactor; //! factor that is multiplied to all material densities (ONLY for systematic studies) - private: AliModule(const AliModule&); AliModule& operator=(const AliModule&); - ClassDef(AliModule, 9) //Base class for ALICE Modules + ClassDef(AliModule, 10) //Base class for ALICE Modules }; #endif diff --git a/STEER/STEER/AliRunLoader.cxx b/STEER/STEER/AliRunLoader.cxx index d04b9eb86bb..7882179df34 100644 --- a/STEER/STEER/AliRunLoader.cxx +++ b/STEER/STEER/AliRunLoader.cxx @@ -63,7 +63,6 @@ #include #include #include -#include ClassImp(AliRunLoader) @@ -1870,68 +1869,6 @@ void AliRunLoader::Clean(const TString& name) /*****************************************************************************/ -TTask* AliRunLoader::GetRunDigitizer() -{ -//returns Run Digitizer from folder - - TFolder* topf = AliConfig::Instance()->GetTaskFolder(); - TObject* obj = topf->FindObjectAny(AliConfig::Instance()->GetDigitizerTaskName()); - return (obj)?dynamic_cast(obj):0x0; -} -/*****************************************************************************/ - -TTask* AliRunLoader::GetRunSDigitizer() -{ -//returns SDigitizer Task from folder - - TFolder* topf = AliConfig::Instance()->GetTaskFolder(); - TObject* obj = topf->FindObjectAny(AliConfig::Instance()->GetSDigitizerTaskName()); - return (obj)?dynamic_cast(obj):0x0; -} -/*****************************************************************************/ - -TTask* AliRunLoader::GetRunReconstructioner() -{ -//returns Reconstructioner Task from folder - TFolder* topf = AliConfig::Instance()->GetTaskFolder(); - TObject* obj = topf->FindObjectAny(AliConfig::Instance()->GetReconstructionerTaskName()); - return (obj)?dynamic_cast(obj):0x0; -} -/*****************************************************************************/ - -TTask* AliRunLoader::GetRunTracker() -{ -//returns Tracker Task from folder - TFolder* topf = AliConfig::Instance()->GetTaskFolder(); - TObject* obj = topf->FindObjectAny(AliConfig::Instance()->GetTrackerTaskName()); - return (obj)?dynamic_cast(obj):0x0; -} -/*****************************************************************************/ - -TTask* AliRunLoader::GetRunPIDTask() -{ -//returns Tracker Task from folder - TFolder* topf = AliConfig::Instance()->GetTaskFolder(); - TObject* obj = topf->FindObjectAny(AliConfig::Instance()->GetPIDTaskName()); - return (obj)?dynamic_cast(obj):0x0; -} -/*****************************************************************************/ - -TTask* AliRunLoader::GetRunQATask() -{ -//returns Quality Assurance Task from folder - TFolder* topf = AliConfig::Instance()->GetTaskFolder(); - if (topf == 0x0) - { - AliErrorClass("Can not get task folder from AliConfig"); - return 0x0; - } - TObject* obj = topf->FindObjectAny(AliConfig::Instance()->GetQATaskName()); - return (obj)?dynamic_cast(obj):0x0; -} - -/*****************************************************************************/ - void AliRunLoader::SetCompressionLevel(Int_t cl) { //Sets Compression Level in all files diff --git a/STEER/STEER/AliRunLoader.h b/STEER/STEER/AliRunLoader.h index 8db2fc899a5..07303fc9e83 100644 --- a/STEER/STEER/AliRunLoader.h +++ b/STEER/STEER/AliRunLoader.h @@ -27,7 +27,6 @@ class TString; class TFolder; class TObjArray; class TTree; -class TTask; class TParticle; class AliRun; @@ -183,14 +182,6 @@ class AliRunLoader: public TNamed static TTree* GetTreeT(const char* detname, Bool_t maketree, const char* eventfoldername); static TTree* GetTreeP(const char* detname, Bool_t maketree, const char* eventfoldername); -// Tasks are supposed to be singletons, that is why following methods are static - static TTask* GetRunDigitizer(); // - static TTask* GetRunSDigitizer(); // - static TTask* GetRunReconstructioner(); // - static TTask* GetRunTracker(); // - static TTask* GetRunPIDTask(); // - static TTask* GetRunQATask(); // - static TString GetRunLoaderName () {return fgkRunLoaderName;} static TString GetHeaderContainerName () {return fgkHeaderContainerName;} static TString GetTriggerContainerName () {return fgkTriggerContainerName;} diff --git a/STEER/STEER/AliSimulation.cxx b/STEER/STEER/AliSimulation.cxx index bb493bd5f5f..9460d9afec8 100644 --- a/STEER/STEER/AliSimulation.cxx +++ b/STEER/STEER/AliSimulation.cxx @@ -145,7 +145,7 @@ #include "AliRawReaderFile.h" #include "AliRawReaderRoot.h" #include "AliRun.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliRunLoader.h" #include "AliSimulation.h" #include "AliSysInfo.h" @@ -1266,50 +1266,56 @@ Bool_t AliSimulation::RunDigitization(const char* detectors, Int_t nStreams = 1; if (fBkgrdFileNames) nStreams = fBkgrdFileNames->GetEntriesFast() + 1; Int_t signalPerBkgrd = GetNSignalPerBkgrd(); - AliRunDigitizer* manager = new AliRunDigitizer(nStreams, signalPerBkgrd); - // manager->SetEmbeddingFlag(fEmbeddingFlag); - manager->SetInputStream(0, fGAliceFileName.Data()); + AliDigitizationInput digInp(nStreams, signalPerBkgrd); + // digInp.SetEmbeddingFlag(fEmbeddingFlag); + digInp.SetRegionOfInterest(fRegionOfInterest); + digInp.SetInputStream(0, fGAliceFileName.Data()); for (Int_t iStream = 1; iStream < nStreams; iStream++) { - const char* fileName = ((TObjString*) - (fBkgrdFileNames->At(iStream-1)))->GetName(); - manager->SetInputStream(iStream, fileName); + const char* fileName = ((TObjString*)(fBkgrdFileNames->At(iStream-1)))->GetName(); + digInp.SetInputStream(iStream, fileName); } - + TObjArray detArr; + detArr.SetOwner(kTRUE); TString detStr = detectors; TString detExcl = excludeDetectors; - manager->GetInputStream(0)->ImportgAlice(); - AliRunLoader* runLoader = - AliRunLoader::GetRunLoader(manager->GetInputStream(0)->GetFolderName()); + if (!static_cast(digInp.GetInputStream(0))->ImportgAlice()) { + AliError("Error occured while getting gAlice from Input 0"); + return kFALSE; + } + AliRunLoader* runLoader = AliRunLoader::GetRunLoader(digInp.GetInputStream(0)->GetFolderName()); TObjArray* detArray = runLoader->GetAliRun()->Detectors(); for (Int_t iDet = 0; iDet < detArray->GetEntriesFast(); iDet++) { AliModule* det = (AliModule*) detArray->At(iDet); if (!det || !det->IsActive()) continue; - if (IsSelected(det->GetName(), detStr) && - !IsSelected(det->GetName(), detExcl)) { - AliDigitizer* digitizer = det->CreateDigitizer(manager); - - if (!digitizer) { - AliError(Form("no digitizer for %s", det->GetName())); - if (fStopOnError) return kFALSE; - } else { - digitizer->SetRegionOfInterest(fRegionOfInterest); - } + if (!IsSelected(det->GetName(), detStr) || IsSelected(det->GetName(), detExcl)) continue; + AliDigitizer* digitizer = det->CreateDigitizer(&digInp); + if (!digitizer || !digitizer->Init()) { + AliError(Form("no digitizer for %s", det->GetName())); + if (fStopOnError) return kFALSE; + else continue; } + detArr.AddLast(digitizer); + AliInfo(Form("Created digitizer from SDigits -> Digits for %s", det->GetName())); } - + // if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) { - AliError(Form("the following detectors were not found: %s", - detStr.Data())); + AliError(Form("the following detectors were not found: %s", detStr.Data())); if (fStopOnError) return kFALSE; } - - if (!manager->GetListOfTasks()->IsEmpty()) { - AliInfo("executing digitization"); - manager->Exec(""); - } - - delete manager; - + // + Int_t ndigs = detArr.GetEntriesFast(); + Int_t eventsCreated = 0; + AliRunLoader* outRl = digInp.GetOutRunLoader(); + while ((eventsCreated++ < fNEvents) || (fNEvents < 0)) { + if (!digInp.ConnectInputTrees()) break; + digInp.InitEvent(); //this must be after call of Connect Input tress. + if (outRl) outRl->SetEventNumber(eventsCreated-1); + static_cast(digInp.GetInputStream(0))->ImportgAlice(); // use gAlice of the first input stream + for (int id=0;idDigitize(""); + digInp.FinishEvent(); + }; + digInp.FinishGlobal(); + // return kTRUE; } diff --git a/STEER/STEER/AliTaskLoader.cxx b/STEER/STEER/AliTaskLoader.cxx deleted file mode 100644 index c7b1a92ac88..00000000000 --- a/STEER/STEER/AliTaskLoader.cxx +++ /dev/null @@ -1,110 +0,0 @@ - -///////////////////////////////////////////////////////////////////////////////////////////// -// // -// class AliTaskLoader // -// // -// Container of all data needed for full // -// description of each data type // -// (Hits, Kine, ...) // -// // -// Each data loader has a basic standard setup of BaseLoaders // -// which can be identuified by indexes (defined by EStdBasicLoaders) // -// Data managed by these standard base loaders has fixed naming convention // -// e.g. - tree with hits is always named TreeH // -// (defined in AliLoader::fgkDefaultHitsContainerName) // -// - task DtectorName+Name defined // -// // -// EStdBasicLoaders idx Object Type Description // -// kData 0 TTree or TObject main data itself (hits,digits,...) // -// kTask 1 TTask object producing main data // -// kQA 2 TTree quality assurance tree // -// kQATask 3 TTask task producing QA object // -// // -// // -// User can define and add more basic loaders even Run Time. // -// Caution: in order to save information about added base loader // -// user must rewrite Run Loader to galice.file, overwriting old setup // -// // -///////////////////////////////////////////////////////////////////////////////////////////// - -/* $Id$ */ - -#include "AliTaskLoader.h" -#include "AliDataLoader.h" -#include "AliLog.h" - -ClassImp(AliTaskLoader) - -//______________________________________________________________________________ -AliTaskLoader::AliTaskLoader(const TString& name, AliDataLoader* dl, - TTask* parentaltask, Bool_t storeontop): - AliBaseLoader(name,dl,storeontop), - fParentalTask(parentaltask) -{ - // - // Constructor - // -} - -//______________________________________________________________________________ -void AliTaskLoader::Clean() -{ - // - // Removes tasl from parental task - // DO NOT DELETE OBJECT contrary to BaseLoader - // - AliDebug(1, Form("Clean %s %s",GetName(),GetDataLoader()->GetName())); - TObject* obj = Get(); - if(obj) - { - AliDebug(1, Form("cleaning %s.",GetName())); - RemoveFromBoard(obj); - } -} - - -//______________________________________________________________________________ -void AliTaskLoader::RemoveFromBoard(TObject* obj) -{ - // - // Removes the task "obj" from the board - // - GetParentalTask()->GetListOfTasks()->Remove(obj); -} - -//______________________________________________________________________________ -Int_t AliTaskLoader::AddToBoard(TObject* obj) -{ - // - // Adds task "obj" to the board - // - TTask* task = dynamic_cast(obj); - if (task == 0x0) - { - AliError("To TTask board can be added only tasks."); - return 1; - } - GetParentalTask()->Add(task); - return 0; -} - -//______________________________________________________________________________ -TObject* AliTaskLoader::Get() const -{ - // - // Returns pointer to the current task - // - return (GetParentalTask()) ? GetParentalTask()->GetListOfTasks()->FindObject(GetName()) : 0x0; -} - -//______________________________________________________________________________ -TTask* AliTaskLoader::GetParentalTask() const -{ - // - // Returns parental tasks for this task - // - return fParentalTask; -} - - - diff --git a/STEER/STEER/AliTaskLoader.h b/STEER/STEER/AliTaskLoader.h deleted file mode 100644 index bd86c4e9249..00000000000 --- a/STEER/STEER/AliTaskLoader.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef ALITASKLOADER_H -#define ALITASKLOADER_H -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ - -//////////////////////////////////////////// -// // -// class AliTaskLoader // -// // -// // -//////////////////////////////////////////// - -/* $Id$ */ - -class TObject; -class AliDataLoader; - -#include "AliBaseLoader.h" -#include - -class AliTaskLoader: public AliBaseLoader - { - public: - AliTaskLoader():fParentalTask(0x0){}; - AliTaskLoader(const TString& name, AliDataLoader* dl, TTask* parentaltask, Bool_t storeontop = kFALSE); - virtual ~AliTaskLoader(){}; - - TObject* Get() const; - virtual TTask* Task() const {return dynamic_cast(Get());} - virtual void Clean(); - - protected: - Int_t AddToBoard(TObject* obj); - void RemoveFromBoard(TObject* obj); - TTask* GetParentalTask() const; - - private: - AliTaskLoader(const AliTaskLoader&); //Not implemented - AliTaskLoader& operator=(const AliTaskLoader&); //Not implemented - - TTask* fParentalTask; // Parental task - - ClassDef(AliTaskLoader,1) - }; - -#endif - - diff --git a/STEER/STEERLinkDef.h b/STEER/STEERLinkDef.h index 85ad5cca6a4..39123684883 100644 --- a/STEER/STEERLinkDef.h +++ b/STEER/STEERLinkDef.h @@ -35,7 +35,7 @@ #pragma link C++ class AliDebugVolume+; #pragma link C++ class AliConfig+; #pragma link C++ class AliDigitizer+; -#pragma link C++ class AliRunDigitizer+; +#pragma link C++ class AliDigitizationInput+; #pragma link C++ class AliStream+; #pragma link C++ class AliMergeCombi+; #pragma link C++ class AliGausCorr+; @@ -44,7 +44,6 @@ #pragma link C++ class AliBaseLoader+; #pragma link C++ class AliObjectLoader+; #pragma link C++ class AliTreeLoader+; -#pragma link C++ class AliTaskLoader+; #pragma link C++ class AliRunLoader+; #pragma link C++ class AliReconstructor+; #pragma link C++ class AliMemoryWatcher+; diff --git a/T0/AliT0.cxx b/T0/AliT0.cxx index d2c2c78725a..46752954b1d 100644 --- a/T0/AliT0.cxx +++ b/T0/AliT0.cxx @@ -292,9 +292,9 @@ void AliT0::MakeBranchInTreeD(TTree *treeD, const char *file) } //_____________________________________________________________________________ -AliDigitizer* AliT0::CreateDigitizer(AliRunDigitizer* manager) const +AliDigitizer* AliT0::CreateDigitizer(AliDigitizationInput* digInput) const { - return new AliT0Digitizer(manager); + return new AliT0Digitizer(digInput); } //____________________________________________________________________________ void AliT0::Digits2Raw() diff --git a/T0/AliT0.h b/T0/AliT0.h index d079a8c75e6..778ac306304 100644 --- a/T0/AliT0.h +++ b/T0/AliT0.h @@ -46,7 +46,7 @@ public: virtual void SetTreeAddress(); virtual void MakeBranchInTreeD(TTree *treeD, const char *file=0); // virtual AliLoader* MakeLoader(const char* topfoldername); - virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; + virtual AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const; void Digits2Raw (); void Raw2Digits (AliRawReader *reader,TTree* digitsTree); virtual AliTriggerDetector* CreateTriggerDetector() const diff --git a/T0/AliT0Digitizer.cxx b/T0/AliT0Digitizer.cxx index 4fad34e4844..e113c62b239 100644 --- a/T0/AliT0Digitizer.cxx +++ b/T0/AliT0Digitizer.cxx @@ -41,7 +41,7 @@ #include "AliT0.h" #include "AliT0hit.h" #include "AliT0digit.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliRun.h" #include #include @@ -69,8 +69,8 @@ ClassImp(AliT0Digitizer) } //___________________________________________ -AliT0Digitizer::AliT0Digitizer(AliRunDigitizer* manager) - :AliDigitizer(manager), +AliT0Digitizer::AliT0Digitizer(AliDigitizationInput* digInput) + :AliDigitizer(digInput), fT0(0), fHits(0), fdigits(0), @@ -153,7 +153,7 @@ Bool_t AliT0Digitizer::Init() } //--------------------------------------------------------------------- -void AliT0Digitizer::Exec(Option_t* /*option*/) +void AliT0Digitizer::Digitize(Option_t* /*option*/) { /* @@ -167,7 +167,7 @@ void AliT0Digitizer::Exec(Option_t* /*option*/) */ //output loader - AliRunLoader *outRL = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); + AliRunLoader *outRL = AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName()); AliLoader * pOutStartLoader = outRL->GetLoader("T0Loader"); AliDebug(1,"start..."); @@ -202,7 +202,7 @@ void AliT0Digitizer::Exec(Option_t* /*option*/) AliT0hit *startHit; TBranch *brHits=0; - Int_t nFiles=fManager->GetNinputs(); + Int_t nFiles=fDigInput->GetNinputs(); for (Int_t inputFile=0; inputFileGetInputFolderName(inputFile)); + AliRunLoader * inRL = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(inputFile)); AliLoader * pInStartLoader = inRL->GetLoader("T0Loader"); if (!inRL->GetAliRun()) inRL->LoadgAlice(); fT0 = (AliT0*)inRL ->GetAliRun()->GetDetector("T0"); diff --git a/T0/AliT0Digitizer.h b/T0/AliT0Digitizer.h index 26b43ab576c..37c13c9779f 100644 --- a/T0/AliT0Digitizer.h +++ b/T0/AliT0Digitizer.h @@ -10,7 +10,7 @@ #include #include "AliT0Parameters.h" -#include +#include class AliT0; class AliT0hit; class AliT0digit; @@ -19,7 +19,7 @@ class AliT0Digitizer : public AliDigitizer { public: AliT0Digitizer(); - AliT0Digitizer(AliRunDigitizer * manager); + AliT0Digitizer(AliDigitizationInput * digInput); virtual ~AliT0Digitizer(); virtual Bool_t Init(); TClonesArray *Hits() const {return fHits;} @@ -29,7 +29,7 @@ class AliT0Digitizer : public AliDigitizer { TArrayI * ADC0() {return fADC0;} // Do the main work - void Exec (Option_t* /*option=0*/) ; + void Digitize(Option_t* /*option=0*/) ; // Bool_t RegisterPhotoE(Int_t impt, Double_t energy); enum {kBgTag = -1}; diff --git a/T0/AliT0Loader.cxx b/T0/AliT0Loader.cxx index 5852b091da4..9ea71d4dff5 100644 --- a/T0/AliT0Loader.cxx +++ b/T0/AliT0Loader.cxx @@ -24,8 +24,6 @@ void AliT0Loader::InitObjectLoaders() delete fDataLoaders->Remove(fDataLoaders->At(kDigits)); } AliDataLoader* dl = new AliDataLoader(fDetectorName + ".Digits.root","T0_D", "Digits","O");//we want to have object data not tree - AliTaskLoader* tl = new AliTaskLoader(fDetectorName + AliConfig::Instance()->GetDigitizerTaskName(),dl,AliRunLoader::GetRunDigitizer(),kTRUE); - dl->SetBaseTaskLoader(tl); fDataLoaders->AddAt(dl,kDigits); // R E C O N S T R U C T E D P O I N T S, here: V E R T E X @@ -33,7 +31,5 @@ void AliT0Loader::InitObjectLoaders() delete fDataLoaders->Remove(fDataLoaders->At(kRecPoints)); } dl = new AliDataLoader(fDetectorName + ".RecPoints.root","T0_V", "Reconstructed Points","O");//we want to have object data not tree - tl = new AliTaskLoader(fDetectorName + AliConfig::Instance()->GetReconstructionerTaskName(),dl,AliRunLoader::GetRunReconstructioner(),kTRUE); - dl->SetBaseTaskLoader(tl); fDataLoaders->AddAt(dl,kRecPoints); } diff --git a/TOF/AliTOF.cxx b/TOF/AliTOF.cxx index 76168ace204..8b8cf671bae 100644 --- a/TOF/AliTOF.cxx +++ b/TOF/AliTOF.cxx @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include @@ -79,8 +78,6 @@ ClassImp(AliTOF) //_____________________________________________________________________________ AliTOF::AliTOF(): fFGeom(0x0), - fDTask(0x0), - fReTask(0x0), fSDigits(0x0), fNSDigits(0), fReconParticles(0x0), @@ -108,8 +105,6 @@ AliTOF::AliTOF(const char *name, const char *title, Option_t *option) : AliDetector(name,title), fFGeom(0x0), - fDTask(0x0), - fReTask(0x0), fSDigits(0x0), fNSDigits(0), fReconParticles(0x0), @@ -197,7 +192,6 @@ void AliTOF::GetTOFSectors(Int_t *sectors) const void AliTOF::CreateTOFFolders() { // create the ALICE TFolder - // create the ALICE TTasks // create the ALICE main TFolder // to be done by AliRun @@ -210,31 +204,6 @@ void AliTOF::CreateTOFFolders() aliceF->SetOwner() ; // geometry folder TFolder * geomF = aliceF->AddFolder("Geometry", "Geometry objects") ; - TFolder * aliceT = alice->AddFolder("tasks", "Alice tasks Folder") ; - // make it the owner of the objects that it contains - aliceT->SetOwner() ; - - TTask * aliceDi = new TTask("(S)Digitizer", "Alice SDigitizer & Digitizer") ; - aliceT->Add(aliceDi); - - TTask * aliceRe = new TTask("Reconstructioner", "Alice Reconstructioner") ; - aliceT->Add(aliceRe); - - const Int_t kSize=80; - //char * tempo = new char[80] ; - char tempo[kSize]; - - // creates the TOF Digitizer and adds it to alice main (S)Digitizer task - snprintf(tempo,kSize, "%sDigitizers container",GetName() ) ; - fDTask = new TTask(GetName(), tempo); - aliceDi->Add(fDTask) ; - - // creates the TOF reconstructioner and adds it to alice main Reconstructioner task - snprintf(tempo,kSize, "%sReconstructioner container",GetName() ) ; - fReTask = new TTask(GetName(), tempo); - aliceRe->Add(fReTask) ; - - //delete [] tempo ; // creates the TOF geometry folder geomF->AddFolder("TOF", "Geometry for TOF") ; @@ -245,7 +214,6 @@ AliTOF::~AliTOF() { // dtor: // it remove also the alice folder - // and task that TOF creates instead of AliRun /* PH Temporarily commented because of problems TFolder * alice = (TFolder*)gROOT->GetListOfBrowsables()->FindObject("FPAlice") ; delete alice; @@ -552,8 +520,8 @@ void AliTOF::Hits2SDigits() //ToAliDebug(1, sd.Print("")); //AliInfo("ToAliDebug"); - //sd.Exec("all") ; - sd.Exec("partial") ; + //sd.Digitize("all") ; + sd.Digitize("partial") ; AliDebug(2,"I am sorting from AliTOF class"); @@ -575,15 +543,15 @@ void AliTOF::Hits2SDigits(Int_t evNumber1, Int_t evNumber2) AliTOFSDigitizer sd((rl->GetFileName()).Data(),evNumber1,evNumber2) ; ToAliDebug(1, sd.Print("")); - sd.Exec("") ; + sd.Digitize("") ; } //___________________________________________________________________________ -AliDigitizer* AliTOF::CreateDigitizer(AliRunDigitizer* manager) const +AliDigitizer* AliTOF::CreateDigitizer(AliDigitizationInput* digInput) const { AliDebug(2,"I am creating the TOF digitizer"); - return new AliTOFDigitizer(manager); + return new AliTOFDigitizer(digInput); } //___________________________________________________________________________ diff --git a/TOF/AliTOF.h b/TOF/AliTOF.h index 5d08443513e..7eb64cbc36c 100644 --- a/TOF/AliTOF.h +++ b/TOF/AliTOF.h @@ -26,7 +26,6 @@ class TDirectory; class TFile; class TFolder ; class TString ; -class TTask ; class AliTOFGeometry; @@ -65,7 +64,7 @@ public: //virtual void Hits2Digits(); virtual void Hits2SDigits(); virtual void Hits2SDigits(Int_t evNumber1, Int_t evNumber2); - virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; + virtual AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const; virtual void Digits2Reco () {}; void Digits2Raw (); void Raw2Digits () {}; @@ -90,8 +89,6 @@ public: protected: TFolder* fFGeom ; // Folder that holds the Geometry definition - TTask* fDTask ; // TOF Digitizer container - TTask* fReTask; // TOF Reconstructioner container TClonesArray* fSDigits; //! List of summable digits Int_t fNSDigits; //! Number of sdigits TClonesArray* fReconParticles; // List of reconstructed particles @@ -115,7 +112,7 @@ private: AliTOF(const AliTOF &source); // copy constructor AliTOF& operator=(const AliTOF &source); // ass. op. - ClassDef(AliTOF,11) // Time Of Flight base class + ClassDef(AliTOF,12) // Time Of Flight base class }; #endif /* ALITOF_H */ diff --git a/TOF/AliTOFClusterFinder.cxx b/TOF/AliTOFClusterFinder.cxx index 8de8eb7d93b..e0286fb8a85 100644 --- a/TOF/AliTOFClusterFinder.cxx +++ b/TOF/AliTOFClusterFinder.cxx @@ -139,7 +139,7 @@ Revision 0.01 2005/07/25 A. De Caro ClassImp(AliTOFClusterFinder) AliTOFClusterFinder::AliTOFClusterFinder(AliTOFcalib *calib): - TTask("AliTOFClusterFinder",""), + TNamed("AliTOFClusterFinder",""), fRunLoader(0), fTOFLoader(0), fTreeD(0), @@ -170,7 +170,7 @@ AliTOFClusterFinder::AliTOFClusterFinder(AliTOFcalib *calib): //______________________________________________________________________________ AliTOFClusterFinder::AliTOFClusterFinder(AliRunLoader* runLoader, AliTOFcalib *calib): - TTask("AliTOFClusterFinder",""), + TNamed("AliTOFClusterFinder",""), fRunLoader(runLoader), fTOFLoader(runLoader->GetLoader("TOFLoader")), fTreeD(0), @@ -200,7 +200,7 @@ AliTOFClusterFinder::AliTOFClusterFinder(AliRunLoader* runLoader, AliTOFcalib *c //------------------------------------------------------------------------ AliTOFClusterFinder::AliTOFClusterFinder(const AliTOFClusterFinder &source) : - TTask(source), + TNamed(source), fRunLoader(0), fTOFLoader(0), fTreeD(0), @@ -227,7 +227,7 @@ AliTOFClusterFinder& AliTOFClusterFinder::operator=(const AliTOFClusterFinder &s if (this == &source) return *this; - TTask::operator=(source); + TNamed::operator=(source); fDigits=source.fDigits; fRecPoints=source.fRecPoints; fVerbose=source.fVerbose; diff --git a/TOF/AliTOFClusterFinder.h b/TOF/AliTOFClusterFinder.h index 3be1b715d66..59f81b9c34f 100644 --- a/TOF/AliTOFClusterFinder.h +++ b/TOF/AliTOFClusterFinder.h @@ -6,7 +6,7 @@ // Task: Transform digits/raw data to TOF Clusters, to fill TOF RecPoints // and feed TOF tracking -#include "TTask.h" +#include "TNamed.h" #include "AliTOFRawStream.h" @@ -22,7 +22,7 @@ class AliTOFGeometry; class AliTOFcluster; class AliTOFcalib; -class AliTOFClusterFinder : public TTask +class AliTOFClusterFinder : public TNamed { enum {kTofMaxCluster=77777}; //maximal number of the TOF clusters @@ -81,7 +81,7 @@ class AliTOFClusterFinder : public TTask AliTOFcalib *fTOFcalib; // pointer to the TOF calibration info AliTOFRawStream fTOFRawStream; // AliTOFRawStream variable - ClassDef(AliTOFClusterFinder,6) // To run TOF clustering + ClassDef(AliTOFClusterFinder,7) // To run TOF clustering }; #endif diff --git a/TOF/AliTOFClusterFinderV1.cxx b/TOF/AliTOFClusterFinderV1.cxx index 78aff2c9094..2fc971f592c 100644 --- a/TOF/AliTOFClusterFinderV1.cxx +++ b/TOF/AliTOFClusterFinderV1.cxx @@ -64,7 +64,7 @@ ClassImp(AliTOFClusterFinderV1) //_____________________________________________________________________________ AliTOFClusterFinderV1::AliTOFClusterFinderV1(AliTOFcalib *calib): - TTask("AliTOFClusterFinderV1",""), + TNamed("AliTOFClusterFinderV1",""), fRunLoader(0), fDigits(new TClonesArray("AliTOFdigit", 4000)), fRecPoints(new TClonesArray("AliTOFcluster", 4000)), @@ -105,7 +105,7 @@ AliTOFClusterFinderV1::AliTOFClusterFinderV1(AliTOFcalib *calib): //_____________________________________________________________________________ AliTOFClusterFinderV1::AliTOFClusterFinderV1(AliRunLoader* runLoader, AliTOFcalib *calib): - TTask("AliTOFClusterFinderV1",""), + TNamed("AliTOFClusterFinderV1",""), fRunLoader(runLoader), fDigits(new TClonesArray("AliTOFdigit", 4000)), fRecPoints(new TClonesArray("AliTOFcluster", 4000)), @@ -146,7 +146,7 @@ AliTOFClusterFinderV1::AliTOFClusterFinderV1(AliRunLoader* runLoader, AliTOFcali //_____________________________________________________________________________ AliTOFClusterFinderV1::AliTOFClusterFinderV1(const AliTOFClusterFinderV1 &source) - :TTask(source), + :TNamed(source), fRunLoader(0), fDigits(source.fDigits), fRecPoints(source.fRecPoints), diff --git a/TOF/AliTOFClusterFinderV1.h b/TOF/AliTOFClusterFinderV1.h index 0112a85dc30..6ddd971d184 100644 --- a/TOF/AliTOFClusterFinderV1.h +++ b/TOF/AliTOFClusterFinderV1.h @@ -7,7 +7,7 @@ // and feed TOF tracking #include "TObject.h" -#include "TTask.h" +#include "TNamed.h" #include "AliTOFGeometry.h" #include "AliTOFRawStream.h" @@ -72,7 +72,7 @@ class AliTOFselectedDigit : public TObject { }; -class AliTOFClusterFinderV1 : public TTask +class AliTOFClusterFinderV1 : public TNamed { enum {kTofMaxCluster=77777}; //maximal number of the TOF clusters @@ -162,7 +162,7 @@ class AliTOFClusterFinderV1 : public TTask Bool_t fCalibrateTOFtimes; // used for check - ClassDef(AliTOFClusterFinderV1,4) // To run TOF clustering + ClassDef(AliTOFClusterFinderV1,5) // To run TOF clustering }; #endif diff --git a/TOF/AliTOFDigitizer.cxx b/TOF/AliTOFDigitizer.cxx index 8f39f43df20..aa9eb3dc8b6 100644 --- a/TOF/AliTOFDigitizer.cxx +++ b/TOF/AliTOFDigitizer.cxx @@ -36,7 +36,7 @@ #include "AliLoader.h" #include "AliLog.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliRunLoader.h" #include "AliRun.h" @@ -71,8 +71,8 @@ ClassImp(AliTOFDigitizer) } //___________________________________________ -AliTOFDigitizer::AliTOFDigitizer(AliRunDigitizer* manager): - AliDigitizer(manager), +AliTOFDigitizer::AliTOFDigitizer(AliDigitizationInput* digInput): + AliDigitizer(digInput), fDigits(new TClonesArray("AliTOFdigit",4000)), fSDigitsArray(new TClonesArray("AliTOFSDigit",1000)), fhitMap(0x0), @@ -129,7 +129,7 @@ AliTOFDigitizer::~AliTOFDigitizer() //--------------------------------------------------------------------- -void AliTOFDigitizer::Exec(Option_t* /*option*/) +void AliTOFDigitizer::Digitize(Option_t* /*option*/) { // // Perform digitization and merging. @@ -153,7 +153,7 @@ void AliTOFDigitizer::Exec(Option_t* /*option*/) char branchname[kSize]; snprintf(branchname,kSize,"%s", tof->GetName ()); - AliRunLoader* outrl = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); + AliRunLoader* outrl = AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName()); if (outrl == 0x0) { AliError("Can not find Run Loader in output folder."); @@ -184,7 +184,7 @@ void AliTOFDigitizer::Exec(Option_t* /*option*/) // Loop over files to digitize - for (Int_t inputFile=0; inputFileGetNinputs(); + for (Int_t inputFile=0; inputFileGetNinputs(); inputFile++) { ReadSDigit(inputFile); } @@ -306,8 +306,8 @@ void AliTOFDigitizer::ReadSDigit(Int_t inputFile ) static TClonesArray sdigitsClonesArray("AliTOFSDigit", 1000); sdigitsClonesArray.Clear(); - // get the treeS from manager - AliRunLoader* rl = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inputFile)); + // get the treeS from digInput + AliRunLoader* rl = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(inputFile)); if (rl == 0x0) { AliError(Form("Can not find Run Loader in input %d folder.",inputFile)); diff --git a/TOF/AliTOFDigitizer.h b/TOF/AliTOFDigitizer.h index 59d4e53976b..613f7456b4e 100644 --- a/TOF/AliTOFDigitizer.h +++ b/TOF/AliTOFDigitizer.h @@ -19,7 +19,7 @@ #include "AliDigitizer.h" -class AliRunDigitizer; +class AliDigitizationInput; class AliTOFHitMap; class AliTOFSDigit; class AliTOFcalib; @@ -28,13 +28,13 @@ class AliTOFDigitizer : public AliDigitizer { public: AliTOFDigitizer(); - AliTOFDigitizer(AliRunDigitizer * manager); + AliTOFDigitizer(AliDigitizationInput * digInput); virtual ~AliTOFDigitizer(); AliTOFDigitizer(const AliTOFDigitizer &source); // copy constructor AliTOFDigitizer& operator=(const AliTOFDigitizer &source); // ass. op. // Do the main work - void Exec(Option_t* option=0) ; + void Digitize(Option_t* option=0) ; TClonesArray* SDigits() const {return fSDigitsArray;} void ReadSDigit(Int_t inputFile); void CreateDigits(); diff --git a/TOF/AliTOFSDigitizer.cxx b/TOF/AliTOFSDigitizer.cxx index d8f5520fa4a..6854b09e34d 100644 --- a/TOF/AliTOFSDigitizer.cxx +++ b/TOF/AliTOFSDigitizer.cxx @@ -17,7 +17,7 @@ //__________________________________________________________// // // -// This is a TTask that constructs SDigits out of Hits // +// This is a class that constructs SDigits out of Hits // // A Summable Digits is the "sum" of all hits in a pad // // Detector response has been simulated via the method // // SimulateDetectorResponse // @@ -57,7 +57,7 @@ ClassImp(AliTOFSDigitizer) //____________________________________________________________________________ AliTOFSDigitizer::AliTOFSDigitizer(): - TTask("TOFSDigitizer",""), + TNamed("TOFSDigitizer",""), fEvent1(-1), fEvent2(-1), ftail(0x0), @@ -104,7 +104,7 @@ AliTOFSDigitizer::AliTOFSDigitizer(): //------------------------------------------------------------------------ AliTOFSDigitizer::AliTOFSDigitizer(const AliTOFSDigitizer &source): - TTask(source), + TNamed(source), fEvent1(-1), fEvent2(-1), ftail(0x0), @@ -160,7 +160,7 @@ AliTOFSDigitizer& AliTOFSDigitizer::operator=(const AliTOFSDigitizer &/*source*/ //____________________________________________________________________________ AliTOFSDigitizer::AliTOFSDigitizer(const char* HeaderFile, Int_t evNumber1, Int_t nEvents): - TTask("TOFSDigitizer",""), + TNamed("TOFSDigitizer",""), fEvent1(-1), fEvent2(-1), ftail(0x0), @@ -265,16 +265,12 @@ AliTOFSDigitizer::AliTOFSDigitizer(const char* HeaderFile, Int_t evNumber1, Int_ AliFatal("Can not find TOF loader in event. Exiting."); return; } - fTOFLoader->PostSDigitizer(this); - } //____________________________________________________________________________ AliTOFSDigitizer::~AliTOFSDigitizer() { // dtor - fTOFLoader->CleanSDigitizer(); - if (fCalib) delete fCalib; } @@ -350,7 +346,7 @@ Double_t TimeWithTail(const Double_t * const x, const Double_t * const par) } //____________________________________________________________________________ -void AliTOFSDigitizer::Exec(Option_t *verboseOption) { +void AliTOFSDigitizer::Digitize(Option_t *verboseOption) { //execute TOF sdigitization if (strstr(verboseOption,"tim") || strstr(verboseOption,"all")) gBenchmark->Start("TOFSDigitizer"); diff --git a/TOF/AliTOFSDigitizer.h b/TOF/AliTOFSDigitizer.h index 9ab5f43ce73..c0df7d4124b 100644 --- a/TOF/AliTOFSDigitizer.h +++ b/TOF/AliTOFSDigitizer.h @@ -6,7 +6,7 @@ //__________________________________________// // // -// Task Class for making SDigits in TOF // +// Class for making SDigits in TOF // // // //-- Authors: F. Pierella, A. De Caro // // // @@ -14,7 +14,7 @@ /* $Id$ */ -#include "TTask.h" +#include "TNamed.h" class TF1; class TString; @@ -24,7 +24,7 @@ class AliRunLoader; class AliTOFcalib; -class AliTOFSDigitizer: public TTask { +class AliTOFSDigitizer: public TNamed { public: AliTOFSDigitizer() ; // ctor @@ -38,7 +38,7 @@ public: //static Float_t WidthTdcBin() {return fgkTdcBin;}; - virtual void Exec(Option_t *verboseOption); + virtual void Digitize(Option_t *verboseOption); void SetSDigitsFile(char * /*file*/ ) const {;} void InitParameters(); @@ -182,7 +182,7 @@ private: AliTOFcalib * fCalib; //! calibration object - ClassDef(AliTOFSDigitizer,4) // creates TOF SDigits + ClassDef(AliTOFSDigitizer,5) // creates TOF SDigits }; diff --git a/TPC/AliTPC.cxx b/TPC/AliTPC.cxx index 34487b64981..16aaa94319f 100644 --- a/TPC/AliTPC.cxx +++ b/TPC/AliTPC.cxx @@ -1095,9 +1095,9 @@ Bool_t AliTPC::Raw2SDigits(AliRawReader* rawReader){ } //______________________________________________________________________ -AliDigitizer* AliTPC::CreateDigitizer(AliRunDigitizer* manager) const +AliDigitizer* AliTPC::CreateDigitizer(AliDigitizationInput* digInput) const { - return new AliTPCDigitizer(manager); + return new AliTPCDigitizer(digInput); } //__ void AliTPC::SDigits2Digits2(Int_t /*eventnumber*/) diff --git a/TPC/AliTPC.h b/TPC/AliTPC.h index 9324b542ddf..7e519229601 100644 --- a/TPC/AliTPC.h +++ b/TPC/AliTPC.h @@ -41,7 +41,7 @@ public: virtual void CreateMaterials(); virtual void AddAlignableVolumes() const {} - virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; + virtual AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const; virtual void SDigits2Digits(){;} //MI change -cycling to production virtual void SDigits2Digits2(Int_t eventnumber=0); diff --git a/TPC/AliTPCDigitizer.cxx b/TPC/AliTPCDigitizer.cxx index fa2aef886aa..0bee1a63e12 100644 --- a/TPC/AliTPCDigitizer.cxx +++ b/TPC/AliTPCDigitizer.cxx @@ -48,7 +48,7 @@ #include "AliRun.h" #include "AliLoader.h" #include "AliPDG.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliSimDigits.h" #include "AliLog.h" @@ -68,13 +68,13 @@ ClassImp(AliTPCDigitizer) } //___________________________________________ -AliTPCDigitizer::AliTPCDigitizer(AliRunDigitizer* manager) - :AliDigitizer(manager),fDebug(0) +AliTPCDigitizer::AliTPCDigitizer(AliDigitizationInput* digInput) + :AliDigitizer(digInput),fDebug(0) { // // ctor which should be used // - AliDebug(2,"(AliRunDigitizer* manager) was processed"); + AliDebug(2,"(AliDigitizationInput* digInput) was processed"); } //------------------------------------------------------------------------ @@ -95,12 +95,12 @@ Bool_t AliTPCDigitizer::Init() //------------------------------------------------------------------------ -void AliTPCDigitizer::Exec(Option_t* option) +void AliTPCDigitizer::Digitize(Option_t* option) { - ExecFast(option); + DigitizeFast(option); } //------------------------------------------------------------------------ -void AliTPCDigitizer::ExecFast(Option_t* option) +void AliTPCDigitizer::DigitizeFast(Option_t* option) { // merge input tree's with summable digits @@ -109,7 +109,7 @@ void AliTPCDigitizer::ExecFast(Option_t* option) char ss[100]; TString optionString = option; if (!strcmp(optionString.Data(),"deb")) { - cout<<"AliTPCDigitizer::Exec: called with option deb "<GetInputFolderName(0)); + Warning("DigitizeFast","gAlice is NULL. Loading from input 0"); + rl = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(0)); if (rl == 0x0) { - Error("ExecFast","Can not find Run Loader for input 0. Can not proceed."); + Error("DigitizeFast","Can not find Run Loader for input 0. Can not proceed."); return; } rl->LoadgAlice(); @@ -134,7 +134,7 @@ void AliTPCDigitizer::ExecFast(Option_t* option) AliTPCParam * param = pTPC->GetParam(); //sprintf(s,param->GetTitle()); - snprintf(s,100,param->GetTitle()); + snprintf(s,100,"%s",param->GetTitle()); //sprintf(ss,"75x40_100x60"); snprintf(ss,100,"75x40_100x60"); if(strcmp(s,ss)==0){ @@ -153,10 +153,10 @@ void AliTPCDigitizer::ExecFast(Option_t* option) pTPC->GenerNoise(500000); //create table with noise // - Int_t nInputs = fManager->GetNinputs(); + Int_t nInputs = fDigInput->GetNinputs(); Int_t * masks = new Int_t[nInputs]; for (Int_t i=0; iGetMask(i); + masks[i]= fDigInput->GetMask(i); Short_t **pdig= new Short_t*[nInputs]; //pointers to the expanded digits array Int_t **ptr= new Int_t*[nInputs]; //pointers to the expanded tracks array Bool_t *active= new Bool_t[nInputs]; //flag for active input segments @@ -166,7 +166,7 @@ void AliTPCDigitizer::ExecFast(Option_t* option) // make indexes // //create branch's in TPC treeD - orl = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); + orl = AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName()); ogime = orl->GetLoader("TPCLoader"); TTree * tree = ogime->TreeD(); AliSimDigits * digrow = new AliSimDigits; @@ -183,7 +183,7 @@ void AliTPCDigitizer::ExecFast(Option_t* option) { digarr[i1]=0; // intree[i1] - rl = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(i1)); + rl = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(i1)); gime = rl->GetLoader("TPCLoader"); gime->LoadSDigits("read"); TTree * treear = gime->TreeS(); @@ -260,7 +260,7 @@ void AliTPCDigitizer::ExecFast(Option_t* option) for (Int_t i=0;iGetInputFolderName(i)); + rl = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(i)); gime = rl->GetLoader("TPCLoader"); if (gime->TreeS()->GetEntryWithIndex(segmentID,segmentID) >= 0) { @@ -269,11 +269,11 @@ void AliTPCDigitizer::ExecFast(Option_t* option) nrows = digarr[i]->GetNRows(); ncols = digarr[i]->GetNCols(); active[i] = kTRUE; - if (!fRegionOfInterest || (i == 0)) digitize = kTRUE; + if (!GetRegionOfInterest() || (i == 0)) digitize = kTRUE; } else { active[i] = kFALSE; } - if (fRegionOfInterest && !digitize) break; + if (GetRegionOfInterest() && !digitize) break; } if (!digitize) continue; @@ -358,11 +358,11 @@ void AliTPCDigitizer::ExecFast(Option_t* option) } //for (Int_t n=0; nGetNRowsTotal(); n++) - orl = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); + orl = AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName()); ogime = orl->GetLoader("TPCLoader"); ogime->WriteDigits("OVERWRITE"); - //fManager->GetTreeDTPC()->Write(0,TObject::kOverwrite); + //fDigInput->GetTreeDTPC()->Write(0,TObject::kOverwrite); delete digrow; for (Int_t i1=0;i1GetOutputFolderName()); + orl = AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName()); ogime = orl->GetLoader("TPCLoader"); - rl = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(0)); + rl = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(0)); //gime = rl->GetLoader("TPCLoader"); rl->GetLoader("TPCLoader"); rl->LoadgAlice(); @@ -406,13 +406,13 @@ void AliTPCDigitizer::ExecSave(Option_t* option) pTPC->GenerNoise(500000); //create teble with noise printf("noise %f \n", param->GetNoise()*param->GetNoiseNormFac()); // - Int_t nInputs = fManager->GetNinputs(); + Int_t nInputs = fDigInput->GetNinputs(); // stupid protection... if (nInputs <= 0) return; // Int_t * masks = new Int_t[nInputs]; for (Int_t i=0; iGetMask(i); + masks[i]= fDigInput->GetMask(i); AliSimDigits ** digarr = new AliSimDigits*[nInputs]; for(Int_t ii=0;iiGetInputFolderName(i1)); + rl = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(i1)); gime = rl->GetLoader("TPCLoader"); TTree * treear = gime->TreeS(); @@ -439,7 +439,7 @@ void AliTPCDigitizer::ExecSave(Option_t* option) treear->GetBranch("Segment")->SetAddress(&digarr[i1]); } - rl = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(0)); + rl = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(0)); gime = rl->GetLoader("TPCLoader"); Stat_t nentries = gime->TreeS()->GetEntries(); @@ -457,7 +457,7 @@ void AliTPCDigitizer::ExecSave(Option_t* option) AliTPCCalPad * gainTPC = AliTPCcalibDB::Instance()->GetDedxGainFactor(); AliTPCCalPad * noiseTPC = AliTPCcalibDB::Instance()->GetPadNoise(); for (Int_t n=0; nGetInputFolderName(0)); + rl = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(0)); gime = rl->GetLoader("TPCLoader"); gime->TreeS()->GetEvent(n); @@ -466,8 +466,8 @@ void AliTPCDigitizer::ExecSave(Option_t* option) for (Int_t i=1;iGetInputTreeTPCS(i)->GetEntryWithIndex(digarr[0]->GetID(),digarr[0]->GetID()); - rl = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(i)); +// fDigInput->GetInputTreeTPCS(i)->GetEntryWithIndex(digarr[0]->GetID(),digarr[0]->GetID()); + rl = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(i)); gime = rl->GetLoader("TPCLoader"); gime->TreeS()->GetEntryWithIndex(digarr[0]->GetID(),digarr[0]->GetID()); digarr[i]->ExpandBuffer(); @@ -554,13 +554,13 @@ void AliTPCDigitizer::ExecSave(Option_t* option) tree->Fill(); if (fDebug>0) cerr<GetInputTreeH(0)->GetName(),fManager->GetInputTreeH(0)->GetListOfBranches()->At(3)); - //fManager->GetTreeDTPC()->Write(0,TObject::kOverwrite); +// printf("end TPC merging - end -Tree %s\t%p\n",fDigInput->GetInputTreeH(0)->GetName(),fDigInput->GetInputTreeH(0)->GetListOfBranches()->At(3)); + //fDigInput->GetTreeDTPC()->Write(0,TObject::kOverwrite); ogime->WriteDigits("OVERWRITE"); for (Int_t i=1;iGetInputFolderName(i)); + rl = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(i)); gime = rl->GetLoader("TPCLoader"); gime->UnloadSDigits(); } diff --git a/TPC/AliTPCDigitizer.h b/TPC/AliTPCDigitizer.h index 7689fe8545c..ee73291de08 100644 --- a/TPC/AliTPCDigitizer.h +++ b/TPC/AliTPCDigitizer.h @@ -7,22 +7,22 @@ #include "AliDigitizer.h" -class AliRunDigitizer; +class AliDigitizationInput; class AliTPCDigitizer : public AliDigitizer { public: AliTPCDigitizer(); - AliTPCDigitizer(AliRunDigitizer * manager); + AliTPCDigitizer(AliDigitizationInput * digInput); virtual ~AliTPCDigitizer(); // Initialize merging and digitization virtual Bool_t Init(); // Do the main work - virtual void Exec(Option_t* option=0); + virtual void Digitize(Option_t* option=0); Int_t GetDebug() const {return fDebug;} // get debug level void SetDebug(Int_t level){fDebug = level;} // set debug level private: - void ExecFast(Option_t* option=0); //digitize - using row pointers - void ExecSave(Option_t* option=0); // digitize using controlled arrays + void DigitizeFast(Option_t* option=0); //digitize - using row pointers + void DigitizeSave(Option_t* option=0); // digitize using controlled arrays Int_t fDebug; private: ClassDef(AliTPCDigitizer,2) // MUON merging/digitization diff --git a/TRD/AliTRD.cxx b/TRD/AliTRD.cxx index da9c0a264a6..727e7085aa8 100644 --- a/TRD/AliTRD.cxx +++ b/TRD/AliTRD.cxx @@ -179,13 +179,13 @@ void AliTRD::Hits2SDigits() } //_____________________________________________________________________________ -AliDigitizer *AliTRD::CreateDigitizer(AliRunDigitizer *manager) const +AliDigitizer *AliTRD::CreateDigitizer(AliDigitizationInput* digInput) const { // // Creates a new digitizer object // - return new AliTRDdigitizer(manager); + return new AliTRDdigitizer(digInput); } diff --git a/TRD/AliTRD.h b/TRD/AliTRD.h index 32e9ca72f3d..fee62a80f74 100644 --- a/TRD/AliTRD.h +++ b/TRD/AliTRD.h @@ -56,7 +56,7 @@ class AliTRD : public AliDetector { virtual Bool_t GetTR() const = 0; AliTRDgeometry *GetGeometry() const { return fGeometry; }; - virtual AliDigitizer *CreateDigitizer(AliRunDigitizer *manager) const; + virtual AliDigitizer *CreateDigitizer(AliDigitizationInput* digInput) const; virtual AliLoader *MakeLoader(const char* topfoldername); virtual AliTriggerDetector *CreateTriggerDetector() const { return new AliTRDTrigger(); } void SetPrimaryIonisation(Bool_t flag = kTRUE) {fPrimaryIonisation = flag;} diff --git a/TRD/AliTRDdigitizer.cxx b/TRD/AliTRDdigitizer.cxx index 502ae93ed7c..d2227fe6cdc 100644 --- a/TRD/AliTRDdigitizer.cxx +++ b/TRD/AliTRDdigitizer.cxx @@ -47,7 +47,7 @@ #include "AliRunLoader.h" #include "AliLoader.h" #include "AliConfig.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliRunLoader.h" #include "AliLoader.h" #include "AliLog.h" @@ -119,9 +119,9 @@ AliTRDdigitizer::AliTRDdigitizer(const Text_t *name, const Text_t *title) } //_____________________________________________________________________________ -AliTRDdigitizer::AliTRDdigitizer(AliRunDigitizer *manager +AliTRDdigitizer::AliTRDdigitizer(AliDigitizationInput* digInput , const Text_t *name, const Text_t *title) - :AliDigitizer(manager,name,title) + :AliDigitizer(digInput,name,title) ,fRunLoader(0) ,fDigitsManager(0) ,fSDigitsManager(0) @@ -142,8 +142,8 @@ AliTRDdigitizer::AliTRDdigitizer(AliRunDigitizer *manager } //_____________________________________________________________________________ -AliTRDdigitizer::AliTRDdigitizer(AliRunDigitizer *manager) - :AliDigitizer(manager,"AliTRDdigitizer","TRD digitizer") +AliTRDdigitizer::AliTRDdigitizer(AliDigitizationInput* digInput) + :AliDigitizer(digInput,"AliTRDdigitizer","TRD digitizer") ,fRunLoader(0) ,fDigitsManager(0) ,fSDigitsManager(0) @@ -262,7 +262,7 @@ void AliTRDdigitizer::Copy(TObject &d) const } //_____________________________________________________________________________ -void AliTRDdigitizer::Exec(const Option_t * const option) +void AliTRDdigitizer::Digitize(const Option_t* option) { // // Executes the merging @@ -285,7 +285,7 @@ void AliTRDdigitizer::Exec(const Option_t * const option) AliDebug(1,"AliRun object found on file."); } else { - inrl = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(0)); + inrl = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(0)); inrl->LoadgAlice(); gAlice = inrl->GetAliRun(); if (!gAlice) { @@ -294,17 +294,17 @@ void AliTRDdigitizer::Exec(const Option_t * const option) } } - Int_t nInput = fManager->GetNinputs(); + Int_t nInput = fDigInput->GetNinputs(); fMasks = new Int_t[nInput]; for (iInput = 0; iInput < nInput; iInput++) { - fMasks[iInput] = fManager->GetMask(iInput); + fMasks[iInput] = fDigInput->GetMask(iInput); } // // Initialization // - AliRunLoader *orl = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); + AliRunLoader *orl = AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName()); if (InitDetector()) { @@ -337,7 +337,7 @@ void AliTRDdigitizer::Exec(const Option_t * const option) AliDebug(1,Form("Add input stream %d",iInput)); // Check if the input tree exists - inrl = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(iInput)); + inrl = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(iInput)); AliLoader *gime = inrl->GetLoader("TRDLoader"); TTree *treees = gime->TreeS(); @@ -358,7 +358,7 @@ void AliTRDdigitizer::Exec(const Option_t * const option) sdigitsManager = new AliTRDdigitsManager(); sdigitsManager->SetSDigits(kTRUE); - AliRunLoader *rl = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(iInput)); + AliRunLoader *rl = AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(iInput)); AliLoader *gimme = rl->GetLoader("TRDLoader"); if (!gimme->TreeS()) { diff --git a/TRD/AliTRDdigitizer.h b/TRD/AliTRDdigitizer.h index fbbefc2dc75..9d4ce296fc7 100644 --- a/TRD/AliTRDdigitizer.h +++ b/TRD/AliTRDdigitizer.h @@ -16,7 +16,7 @@ class TFile; class TF1; -class AliRunDigitizer; +class AliDigitizationInput; class AliRunLoader; class AliTRD; @@ -32,8 +32,8 @@ class AliTRDdigitizer : public AliDigitizer { AliTRDdigitizer(); AliTRDdigitizer(const Text_t *name, const Text_t *title); - AliTRDdigitizer(AliRunDigitizer *manager, const Text_t *name, const Text_t *title); - AliTRDdigitizer(AliRunDigitizer *manager); + AliTRDdigitizer(AliDigitizationInput* digInput, const Text_t *name, const Text_t *title); + AliTRDdigitizer(AliDigitizationInput* digInput); AliTRDdigitizer(const AliTRDdigitizer &d); virtual ~AliTRDdigitizer(); AliTRDdigitizer &operator=(const AliTRDdigitizer &d); @@ -41,7 +41,7 @@ class AliTRDdigitizer : public AliDigitizer { virtual void Copy(TObject &d) const; Bool_t InitDetector(); void InitOutput(Int_t iEvent); - virtual void Exec(const Option_t * const option = 0); + virtual void Digitize(const Option_t * option = 0); virtual Bool_t Open(const Char_t *file, Int_t nEvent = 0); virtual Bool_t Open(AliRunLoader * const runLoader, Int_t nEvent = 0); diff --git a/VZERO/AliVZERO.cxx b/VZERO/AliVZERO.cxx index 356e494cd90..0e69e9dbb07 100755 --- a/VZERO/AliVZERO.cxx +++ b/VZERO/AliVZERO.cxx @@ -52,7 +52,7 @@ #include "AliVZEROLoader.h" #include "AliVZERODigitizer.h" #include "AliVZEROBuffer.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliVZEROdigit.h" #include "AliVZEROSDigit.h" #include "AliDAQ.h" @@ -247,12 +247,12 @@ void AliVZERO::SetTreeAddress() } //_____________________________________________________________________________ -AliDigitizer* AliVZERO::CreateDigitizer(AliRunDigitizer* manager) const +AliDigitizer* AliVZERO::CreateDigitizer(AliDigitizationInput* digInput) const { // // Creates a digitizer for VZERO // - return new AliVZERODigitizer(manager); + return new AliVZERODigitizer(digInput); } //_____________________________________________________________________________ @@ -264,7 +264,7 @@ void AliVZERO::Hits2Digits(){ AliVZERODigitizer* dig = new AliVZERODigitizer(this,AliVZERODigitizer::kHits2Digits); // Creates the digits - dig->Exec(""); + dig->Digitize(""); // deletes the digitizer delete dig; @@ -279,7 +279,7 @@ void AliVZERO::Hits2SDigits(){ AliVZERODigitizer* dig = new AliVZERODigitizer(this,AliVZERODigitizer::kHits2SDigits); // Creates the sdigits - dig->Exec(""); + dig->Digitize(""); // deletes the digitizer delete dig; diff --git a/VZERO/AliVZERO.h b/VZERO/AliVZERO.h index ceb1dc4b48a..c2087644ffd 100755 --- a/VZERO/AliVZERO.h +++ b/VZERO/AliVZERO.h @@ -63,7 +63,7 @@ public: virtual void SetMaxDestepQua(Float_t p1); virtual void SetMaxDestepAlu(Float_t p1); - AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; + AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const; void GetCalibData(); Float_t CorrectLeadingTime(Int_t i, Float_t time, Float_t adc) const; diff --git a/VZERO/AliVZERODigitizer.cxx b/VZERO/AliVZERODigitizer.cxx index 193206e7635..4abae07cc19 100644 --- a/VZERO/AliVZERODigitizer.cxx +++ b/VZERO/AliVZERODigitizer.cxx @@ -41,7 +41,7 @@ #include "AliRunLoader.h" #include "AliLoader.h" #include "AliGRPObject.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliCDBManager.h" #include "AliCDBStorage.h" #include "AliCDBEntry.h" @@ -94,8 +94,8 @@ ClassImp(AliVZERODigitizer) } //____________________________________________________________________________ - AliVZERODigitizer::AliVZERODigitizer(AliRunDigitizer* manager) - :AliDigitizer(manager), + AliVZERODigitizer::AliVZERODigitizer(AliDigitizationInput* digInput) + :AliDigitizer(digInput), fCalibData(GetCalibData()), fPhotoCathodeEfficiency(0.18), fNdigits(0), @@ -219,12 +219,12 @@ Bool_t AliVZERODigitizer::Init() } //____________________________________________________________________________ -void AliVZERODigitizer::Exec(Option_t* /*option*/) +void AliVZERODigitizer::Digitize(Option_t* /*option*/) { // Creates digits from hits fNdigits = 0; - if (fVZERO && !fManager) { + if (fVZERO && !fDigInput) { AliLoader *loader = fVZERO->GetLoader(); if (!loader) { AliError("Can not get VZERO Loader via AliVZERO object!"); @@ -244,10 +244,10 @@ void AliVZERODigitizer::Exec(Option_t* /*option*/) } } } - else if (fManager) { + else if (fDigInput) { ReadSDigits(); DigitizeSDigits(); - AliRunLoader *currentLoader = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); + AliRunLoader *currentLoader = AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName()); AliLoader *loader = currentLoader->GetLoader("VZEROLoader"); if (!loader) { AliError("Cannot get VZERO Loader via RunDigitizer!"); @@ -563,11 +563,11 @@ void AliVZERODigitizer::ReadSDigits() } // Loop over input files - Int_t nFiles= fManager->GetNinputs(); + Int_t nFiles= fDigInput->GetNinputs(); for (Int_t inputFile = 0; inputFile < nFiles; inputFile++) { // Get the current loader AliRunLoader* currentLoader = - AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inputFile)); + AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(inputFile)); AliLoader *loader = currentLoader->GetLoader("VZEROLoader"); loader->LoadSDigits("READ"); @@ -575,7 +575,7 @@ void AliVZERODigitizer::ReadSDigits() // Get the tree of summable digits TTree* sdigitsTree = loader->TreeS(); if (!sdigitsTree) { - AliError("No sdigit tree from manager"); + AliError("No sdigit tree from digInput"); continue; } diff --git a/VZERO/AliVZERODigitizer.h b/VZERO/AliVZERODigitizer.h index 1c2d90e3e20..45a019c76b5 100644 --- a/VZERO/AliVZERODigitizer.h +++ b/VZERO/AliVZERODigitizer.h @@ -19,7 +19,7 @@ class TClonesArray; class TF1; -class AliRunDigitizer; +class AliDigitizationInput; class AliCDBManager; class AliCDBStorage; class AliVZEROCalibData; @@ -36,11 +36,11 @@ class AliVZERODigitizer: public AliDigitizer { AliVZERODigitizer() ; // default constructor AliVZERODigitizer(AliVZERO *vzero, DigiTask_t task); // constructor - AliVZERODigitizer(AliRunDigitizer *manager); // constructor + AliVZERODigitizer(AliDigitizationInput* digInput); // constructor virtual ~AliVZERODigitizer() ; // destructor virtual Bool_t Init(); - virtual void Exec(Option_t* option=0); + virtual void Digitize(Option_t* option=0); void DigitizeHits(); void DigitizeSDigits(); diff --git a/ZDC/AliZDC.cxx b/ZDC/AliZDC.cxx index 8d3b556021c..05a9677fdde 100644 --- a/ZDC/AliZDC.cxx +++ b/ZDC/AliZDC.cxx @@ -408,10 +408,10 @@ void AliZDC::Hits2SDigits() } //_____________________________________________________________________________ -AliDigitizer* AliZDC::CreateDigitizer(AliRunDigitizer* manager) const +AliDigitizer* AliZDC::CreateDigitizer(AliDigitizationInput* digInput) const { // Create the digitizer for ZDC - AliZDCDigitizer *zdcDigitizer = new AliZDCDigitizer(manager); + AliZDCDigitizer *zdcDigitizer = new AliZDCDigitizer(digInput); if(fSpectatorTracked==0) zdcDigitizer->SetSpectators2Track(); //printf("\n**************************ZDC digitizer created with Spectators2Track = %d\n\n", fSpectatorTracked); return zdcDigitizer; diff --git a/ZDC/AliZDC.h b/ZDC/AliZDC.h index ff6baa3d193..af85aa7876a 100644 --- a/ZDC/AliZDC.h +++ b/ZDC/AliZDC.h @@ -36,7 +36,7 @@ public: virtual void SetTreeAddress(); virtual void MakeBranch(Option_t* opt); virtual void Hits2SDigits(); - virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; + virtual AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const; virtual void Digits2Raw(); virtual Bool_t Raw2SDigits(AliRawReader* rawReader); Int_t Pedestal(Int_t Detector, Int_t Quadrant, Int_t Res) const; diff --git a/ZDC/AliZDCDigitizer.cxx b/ZDC/AliZDCDigitizer.cxx index d8b43c933dc..97cb3196935 100644 --- a/ZDC/AliZDCDigitizer.cxx +++ b/ZDC/AliZDCDigitizer.cxx @@ -34,7 +34,7 @@ #include "AliRun.h" #include "AliHeader.h" #include "AliGenHijingEventHeader.h" -#include "AliRunDigitizer.h" +#include "AliDigitizationInput.h" #include "AliRunLoader.h" #include "AliLoader.h" #include "AliGRPObject.h" @@ -66,8 +66,8 @@ AliZDCDigitizer::AliZDCDigitizer() : } //____________________________________________________________________________ -AliZDCDigitizer::AliZDCDigitizer(AliRunDigitizer* manager): - AliDigitizer(manager), +AliZDCDigitizer::AliZDCDigitizer(AliDigitizationInput* digInput): + AliDigitizer(digInput), fIsCalibration(0), //By default the simulation doesn't create calib. data fIsSignalInADCGate(kFALSE), fFracLostSignal(0.), @@ -208,7 +208,7 @@ Bool_t AliZDCDigitizer::Init() } //____________________________________________________________________________ -void AliZDCDigitizer::Exec(Option_t* /*option*/) +void AliZDCDigitizer::Digitize(Option_t* /*option*/) { // Execute digitization @@ -245,11 +245,11 @@ void AliZDCDigitizer::Exec(Option_t* /*option*/) Float_t signalTime0 = 0.; // loop over input streams - for(Int_t iInput = 0; iInputGetNinputs(); iInput++){ + for(Int_t iInput = 0; iInputGetNinputs(); iInput++){ // get run loader and ZDC loader AliRunLoader* runLoader = - AliRunLoader::GetRunLoader(fManager->GetInputFolderName(iInput)); + AliRunLoader::GetRunLoader(fDigInput->GetInputFolderName(iInput)); AliLoader* loader = runLoader->GetLoader("ZDCLoader"); if(!loader) continue; @@ -344,7 +344,7 @@ void AliZDCDigitizer::Exec(Option_t* /*option*/) // get the output run loader and loader AliRunLoader* runLoader = - AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); + AliRunLoader::GetRunLoader(fDigInput->GetOutputFolderName()); AliLoader* loader = runLoader->GetLoader("ZDCLoader"); if(!loader) { AliError("no ZDC loader found"); diff --git a/ZDC/AliZDCDigitizer.h b/ZDC/AliZDCDigitizer.h index 435a9920984..2a2459794bf 100644 --- a/ZDC/AliZDCDigitizer.h +++ b/ZDC/AliZDCDigitizer.h @@ -14,7 +14,7 @@ #include "AliCDBStorage.h" #include "AliZDCPedestals.h" -class AliRunDigitizer; +class AliDigitizationInput; class AliZDC; class AliZDCHit; @@ -24,11 +24,11 @@ class AliZDCDigitizer: public AliDigitizer { public: AliZDCDigitizer(); - AliZDCDigitizer(AliRunDigitizer* manager); + AliZDCDigitizer(AliDigitizationInput* digInput); virtual ~AliZDCDigitizer(); virtual Bool_t Init(); - virtual void Exec(Option_t* option=0); + virtual void Digitize(Option_t* option=0); // PM gain void SetPMGain(Int_t det, Int_t pmDet, Int_t pmGain) -- 2.39.3