From d1775029a6a967cff4e1bb26a56ef64c689f24f4 Mon Sep 17 00:00:00 2001 From: martinez Date: Tue, 2 Mar 2004 14:23:41 +0000 Subject: [PATCH] New Hit2SDigit and SDigit2Digit (JP) --- MUON/AliMUON.cxx | 12 +- MUON/AliMUON.h | 1 + MUON/AliMUONData.cxx | 119 ++++++++- MUON/AliMUONData.h | 9 + MUON/AliMUONDigitizerv2.cxx | 466 +++++++++++++++++++++++++++++++++++ MUON/AliMUONDigitizerv2.h | 51 ++++ MUON/AliMUONSDigitizerv1.cxx | 457 ++++++++++++++++++++++++++++++++++ MUON/AliMUONSDigitizerv1.h | 50 ++++ MUON/MUONHit2SDigit.C | 55 +++++ MUON/MUONLinkDef.h | 4 +- MUON/libMUON.pkg | 5 +- 11 files changed, 1218 insertions(+), 11 deletions(-) create mode 100644 MUON/AliMUONDigitizerv2.cxx create mode 100644 MUON/AliMUONDigitizerv2.h create mode 100644 MUON/AliMUONSDigitizerv1.cxx create mode 100644 MUON/AliMUONSDigitizerv1.h create mode 100644 MUON/MUONHit2SDigit.C diff --git a/MUON/AliMUON.cxx b/MUON/AliMUON.cxx index 56a11c0dd7f..6b345c684cb 100644 --- a/MUON/AliMUON.cxx +++ b/MUON/AliMUON.cxx @@ -77,6 +77,7 @@ #include "AliMUONVGeometryBuilder.h" #include "AliRun.h" #include "AliMUONDigitizerv1.h" +#include "AliMUONSDigitizerv1.h" // Defaults parameters for Z positions of chambers @@ -239,8 +240,8 @@ Int_t AliMUON::DistancetoPrimitive(Int_t , Int_t ) void AliMUON::SetTreeAddress() { GetMUONData()->SetLoader(fLoader); - // GetMUONData()->MakeBranch("D,RC"); - // GetMUONData()->SetTreeAddress("H,D,RC"); + // GetMUONData()->MakeBranch("D,S,RC"); + // GetMUONData()->SetTreeAddress("H,D,S,RC"); GetMUONData()->SetTreeAddress("H"); if (fHits != GetMUONData()->Hits()) { @@ -439,6 +440,13 @@ void AliMUON::SDigits2Digits() fLoader->TreeD()->Reset(); } +//_____________________________________________________________________ +void AliMUON::Hits2SDigits() +{ + // make SDigits from hits + AliMUONSDigitizerv1 SDigitizer = AliMUONSDigitizerv1(); + SDigitizer.Exec(); // make SDigits for current event +} //_______________________________________________________________________ AliLoader* AliMUON::MakeLoader(const char* topfoldername) { diff --git a/MUON/AliMUON.h b/MUON/AliMUON.h index 213c7060020..a8d54167e85 100644 --- a/MUON/AliMUON.h +++ b/MUON/AliMUON.h @@ -66,6 +66,7 @@ class AliMUON : public AliDetector { // Digitisation virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; virtual void SDigits2Digits(); + virtual void Hits2SDigits(); // Configuration Methods (per station id) // // Set Chamber Segmentation Parameters diff --git a/MUON/AliMUONData.cxx b/MUON/AliMUONData.cxx index 7942f9f7e74..38890c6ffd0 100644 --- a/MUON/AliMUONData.cxx +++ b/MUON/AliMUONData.cxx @@ -43,8 +43,10 @@ AliMUONData::AliMUONData():TNamed() // Default constructor fLoader = 0x0; fHits = 0x0; // One event in treeH per primary track - fDigits = 0x0; // One event in treeH per detection plane + fDigits = 0x0; // One event in treeD per detection plane + fSDigits = 0x0; // One event in treeS per detection plane fNdigits = 0x0; + fNSdigits = 0x0; fRawClusters = 0x0; //One event in TreeR/RawclusterBranch per tracking detection plane fGlobalTrigger = 0x0; //! List of Global Trigger 1st event in TreeR/GlobalTriggerBranch fLocalTrigger = 0x0; //! List of Local Trigger, 1st event in TreeR/LocalTriggerBranch @@ -60,8 +62,10 @@ AliMUONData::AliMUONData(AliLoader * loader, const char* name, const char* title // Constructor for AliMUONData fLoader = loader; fHits = 0x0; // One event in treeH per primary track - fDigits = 0x0; // One event in treeH per detection plane + fDigits = 0x0; // One event in treeD per detection plane + fSDigits = 0x0; // One event in treeS per detection plane fNdigits = 0x0; + fNSdigits = 0x0; fRawClusters = 0x0; //One event in TreeR/RawclusterBranch per tracking detection plane fGlobalTrigger = 0x0; //! List of Global Trigger 1st event in TreeR/GlobalTriggerBranch fLocalTrigger = 0x0; //! List of Local Trigger, 1st event in TreeR/LocalTriggerBranch @@ -115,6 +119,10 @@ AliMUONData::~AliMUONData() fDigits->Delete(); delete fDigits; } + if (fSDigits) { + fSDigits->Delete(); + delete fSDigits; + } if (fRawClusters) { fRawClusters->Delete(); delete fRawClusters; @@ -156,6 +164,24 @@ void AliMUONData::AddDigit(Int_t id, const AliMUONDigit& digit) new(ldigits[fNdigits[id]++]) AliMUONDigit(digit); } //_____________________________________________________________________________ +void AliMUONData::AddSDigit(Int_t id, Int_t *tracks, Int_t *charges, Int_t *Sdigits) +{ + // + // Add a MUON Sdigit to the list of SDigits of the detection plane id + // + TClonesArray &lSdigits = * SDigits(id) ; + new(lSdigits[fNSdigits[id]++]) AliMUONDigit(tracks,charges,Sdigits); +} +//_____________________________________________________________________________ +void AliMUONData::AddSDigit(Int_t id, const AliMUONDigit& Sdigit) +{ + // + // Add a MUON Sdigit to the list of SDigits of the detection plane id + // + TClonesArray &lSdigits = * SDigits(id) ; + new(lSdigits[fNSdigits[id]++]) AliMUONDigit(Sdigit); +} +//_____________________________________________________________________________ void AliMUONData::AddGlobalTrigger(Int_t *singlePlus, Int_t *singleMinus, Int_t *singleUndef, Int_t *pairUnlike, Int_t *pairLike) @@ -260,6 +286,15 @@ TClonesArray* AliMUONData::Digits(Int_t DetectionPlane) return NULL; } //____________________________________________________________________________ +TClonesArray* AliMUONData::SDigits(Int_t DetectionPlane) +{ + //Getting List of SDigits + if (fSDigits) + return ( (TClonesArray*) fSDigits->At(DetectionPlane) ); + else + return NULL; +} +//____________________________________________________________________________ Bool_t AliMUONData::IsRawClusterBranchesInTree() { // Checking if there are RawCluster Branches In TreeR @@ -333,6 +368,7 @@ void AliMUONData::Fill(Option_t* option) // Method to fill the trees const char *cH = strstr(option,"H"); const char *cD = strstr(option,"D"); // Digits branches in TreeD + const char *cS = strstr(option,"S"); // SDigits branches in TreeS const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeR const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT @@ -353,6 +389,10 @@ void AliMUONData::Fill(Option_t* option) if ( TreeD() && cD) { TreeD()->Fill(); } + // Filling TreeS + if ( TreeS() && cS) { + TreeS()->Fill(); + } // // filling rawclusters @@ -418,6 +458,7 @@ void AliMUONData::MakeBranch(Option_t* option) const char *cH = strstr(option,"H"); const char *cD = strstr(option,"D"); // Digits branches in TreeD + const char *cS = strstr(option,"S"); // Digits branches in TreeS const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeR const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT @@ -475,6 +516,35 @@ void AliMUONData::MakeBranch(Option_t* option) } } + //Creating Branches for SDigits + if (TreeS() && cS ) { + // one branch for Sdigits per chamber + if (fSDigits == 0x0) { + fSDigits = new TObjArray(AliMUONConstants::NCh()); + for (Int_t iDetectionPlane=0; iDetectionPlaneAddAt(new TClonesArray("AliMUONDigit",10000),iDetectionPlane); + } + } + if (fNSdigits == 0x0) { + fNSdigits = new Int_t[AliMUONConstants::NCh()]; + for (Int_t iDetectionPlane=0; iDetectionPlaneGetBranch(branchname); + if (branch) { + Info("MakeBranch","Branch %s is already in tree.",GetName()); + return; + } + TClonesArray * Sdigits = SDigits(iDetectionPlane); + branch = TreeS()->Branch(branchname, &Sdigits, kBufferSize,1); + //Info("MakeBranch","Making Branch %s for Sdigits in detection plane %d\n",branchname,iDetectionPlane+1); + } + } + if (TreeR() && cRC ) { // one branch for raw clusters per tracking detection plane // @@ -609,6 +679,18 @@ void AliMUONData::ResetDigits() if (fNdigits) fNdigits[i]=0; } } +//____________________________________________________________________________ +void AliMUONData::ResetSDigits() +{ + // + // Reset number of Sdigits and the Sdigits array for this detector + // + if (fSDigits == 0x0) return; + for ( int i=0;iAt(i))->Clear(); + if (fNSdigits) fNSdigits[i]=0; + } +} //______________________________________________________________________________ void AliMUONData::ResetHits() { @@ -655,6 +737,7 @@ void AliMUONData::SetTreeAddress(Option_t* option) //Setting Addresses to the events trees const char *cH = strstr(option,"H"); const char *cD = strstr(option,"D"); // Digits branches in TreeD + const char *cS = strstr(option,"S"); // SDigits branches in TreeS const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeR const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT @@ -670,8 +753,8 @@ void AliMUONData::SetTreeAddress(Option_t* option) if ( TreeH() && cH ) { if (fHits == 0x0) { fHits = new TClonesArray("AliMUONHit",1000); - if (gAlice->GetMCApp()) - gAlice->GetMCApp()->AddHitList (fHits); + // if (gAlice->GetMCApp()) + // gAlice->GetMCApp()->AddHitList (fHits); Moved to AliMUON } fNhits =0; } @@ -706,11 +789,37 @@ void AliMUONData::SetTreeAddress(Option_t* option) if (fDigits) { branch = TreeD()->GetBranch(branchname); TClonesArray * digits = Digits(i); - if (branch) branch->SetAddress( &digits ); + if (branch) { + branch->SetAddress( &digits ); + } else Warning("SetTreeAddress","(%s) Failed for Digits Detection plane %d. Can not find branch in tree.",GetName(),i); } } } + // + // Branch address for Sdigit tree + if ( TreeS() && cS) { + if (fSDigits == 0x0) { + fSDigits = new TObjArray(AliMUONConstants::NCh()); + fNSdigits= new Int_t[AliMUONConstants::NCh()]; + for (Int_t i=0; iAddAt(new TClonesArray("AliMUONDigit",10000),i); + fNSdigits[i]=0; + } + } + } + + if (TreeS() && fSDigits && cS) { + for (int i=0; iGetBranch(branchname); + TClonesArray * Sdigits = SDigits(i); + if (branch) branch->SetAddress( &Sdigits ); + else Warning("SetTreeAddress","(%s) Failed for SDigits Detection plane %d. Can not find branch in tree.",GetName(),i); + } + } + } // // Branch address for rawclusters, globaltrigger and local trigger tree diff --git a/MUON/AliMUONData.h b/MUON/AliMUONData.h index f9be2a6d802..41365556f8e 100644 --- a/MUON/AliMUONData.h +++ b/MUON/AliMUONData.h @@ -43,7 +43,10 @@ class AliMUONData : public TNamed { virtual ~AliMUONData(); virtual void AddDigit(Int_t id, Int_t* tracks, Int_t* charges, Int_t* digits); + virtual void AddSDigit(Int_t id, Int_t* tracks, Int_t* charges, + Int_t* digits); virtual void AddDigit(Int_t, const AliMUONDigit& ); // use copy constructor + virtual void AddSDigit(Int_t, const AliMUONDigit& ); // use copy constructor virtual void AddHit(Int_t fIshunt, Int_t track, Int_t iChamber, Int_t idpart, Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum, Float_t theta, @@ -69,6 +72,7 @@ class AliMUONData : public TNamed { TClonesArray* Hits() {return fHits;} TClonesArray* Digits(Int_t DetectionPlane); + TClonesArray* SDigits(Int_t DetectionPlane); // TClonesArray* LocalTrigger() {return fLocalTrigger;} // TClonesArray* GlobalTrigger() {return fGlobalTrigger;} TClonesArray* LocalTrigger(); @@ -80,6 +84,7 @@ class AliMUONData : public TNamed { void GetTrack(Int_t it) {fLoader->TreeH()->GetEvent(it);} Int_t GetNtracks() {return (Int_t) fLoader->TreeH()->GetEntries();} void GetCathode(Int_t ic) {fLoader->TreeD()->GetEvent(ic);} + void GetCathodeS(Int_t ic) {fLoader->TreeS()->GetEvent(ic);} void GetRawClusters() {fLoader->TreeR()->GetEvent(0);} void GetTrigger() {fLoader->TreeR()->GetEvent(0);} Int_t GetSplitLevel() {return fSplitLevel;} @@ -103,6 +108,7 @@ class AliMUONData : public TNamed { virtual void ResetHits(); virtual void ResetDigits(); + virtual void ResetSDigits(); virtual void ResetTrigger(); virtual void ResetRawClusters(); virtual void ResetRecTracks(); @@ -110,6 +116,7 @@ class AliMUONData : public TNamed { TTree* TreeH() {return fLoader->TreeH(); } TTree* TreeD() {return fLoader->TreeD(); } + TTree* TreeS() {return fLoader->TreeS(); } TTree* TreeR() {return fLoader->TreeR(); } TTree* TreeT() {return fLoader->TreeT(); } TTree* TreeP() {return fLoader->TreeP(); } @@ -123,6 +130,7 @@ class AliMUONData : public TNamed { AliLoader* fLoader; //! Detector Loader pointer TClonesArray* fHits; // One event in treeH per primary track TObjArray* fDigits; // One event in treeD and one branch per detection plane + TObjArray* fSDigits; // One event in treeS and one branch per detection plane TObjArray* fRawClusters; //One event in TreeR/Rawcluster and one branch per tracking detection plane TClonesArray* fGlobalTrigger; // List of Global Trigger One event in TreeR/GlobalTriggerBranch TClonesArray* fLocalTrigger; // List of Local Trigger, One event in TreeR/LocalTriggerBranch @@ -131,6 +139,7 @@ class AliMUONData : public TNamed { Int_t fNhits; //! Number of Hits Int_t* fNdigits;//! Number of Digits + Int_t* fNSdigits;//! Number of Digits Int_t* fNrawclusters;//! Number of Raw Clusters Int_t fNglobaltrigger;//! Number of Global trigger Int_t fNlocaltrigger;//! Number of Local trigger diff --git a/MUON/AliMUONDigitizerv2.cxx b/MUON/AliMUONDigitizerv2.cxx new file mode 100644 index 00000000000..7f433044c50 --- /dev/null +++ b/MUON/AliMUONDigitizerv2.cxx @@ -0,0 +1,466 @@ + +// Do the Digitization (Digit) from summable Digits (SDigit) +// Allow the merging of signal file with background file(s). + +#include +#include +#include +#include +#include +#include +#include + +#include "AliMUON.h" +#include "AliMUONChamber.h" +#include "AliMUONConstants.h" +#include "AliMUONDigit.h" +#include "AliMUONDigitizerv2.h" +#include "AliMUONHit.h" +#include "AliMUONHitMapA1.h" +#include "AliMUONPadHit.h" +#include "AliMUONTransientDigit.h" +#include "AliRun.h" +#include "AliRunDigitizer.h" +#include "AliRunLoader.h" +#include "AliLoader.h" + +ClassImp(AliMUONDigitizerv2) + +//___________________________________________ +AliMUONDigitizerv2::AliMUONDigitizerv2() : + AliDigitizer(), + fHitMap(0), + fTDList(0), + fTDCounter(0), + fDebug(0), + fMask(0), + fSignal(0) +{ +// Default ctor - don't use it + if (GetDebug()>2) + cerr<<"AliMUONDigitizerv2::AliMUONDigitizerv2" + <<"(AliRunDigitizer* manager) was processed"<2) + cerr<<"AliMUONDigitizerv2::AliMUONDigitizerv2" + <<"(AliRunDigitizer* manager) was processed"<Chamber() + (mTD->Cathode()-1) * AliMUONConstants::NCh(); + fTDList->AddAtAndExpand(mTD, fTDCounter); + fHitMap[iNchCpl]->SetHit( mTD->PadX(), mTD->PadY(), fTDCounter); + fTDCounter++; +} + +//------------------------------------------------------------------------ +Bool_t AliMUONDigitizerv2::ExistTransientDigit(AliMUONTransientDigit * mTD) +{ + // Choosing the maping of the cathode plane of the chamber: + Int_t iNchCpl= mTD->Chamber() + (mTD->Cathode()-1) * AliMUONConstants::NCh(); + return( fHitMap[iNchCpl]->TestHit(mTD->PadX(), mTD->PadY()) ); +} + +//------------------------------------------------------------------------ +Bool_t AliMUONDigitizerv2::Init() +{ + +// Initialization + if (GetDebug()>2) Info("Init","AliMUONDigitizerv2::Init() starts"); + + //Loaders (We assume input0 to be the output too) + AliRunLoader * runloader; // Input loader + AliLoader * gime; + + // Getting runloader + runloader = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(0)); + if (runloader == 0x0) { + Error("Init","RunLoader is not in input file 0"); + return kFALSE; // RunDigitizer is not working. + } + // Getting MUONloader + gime = runloader->GetLoader("MUONLoader"); + gime->LoadSDigits("READ"); + gime->LoadDigits("RECREATE"); + + return kTRUE; +} + +//------------------------------------------------------------------------ +void AliMUONDigitizerv2::UpdateTransientDigit(Int_t /*track*/, AliMUONTransientDigit * mTD) +{ + // Choosing the maping of the cathode plane of the chamber: + Int_t iNchCpl= mTD->Chamber() + (mTD->Cathode()-1) * AliMUONConstants::NCh(); + AliMUONTransientDigit *pdigit = + static_cast(fHitMap[iNchCpl]->GetHit(mTD->PadX(),mTD->PadY())); + // update charge + // + Int_t iqpad = mTD->Signal(); // charge per pad + pdigit->AddSignal(iqpad); + pdigit->AddPhysicsSignal(iqpad); + // update list of tracks + // + // List of tracks and trackcharge + Int_t itrack; + for(itrack=0;itrackUpdateTrackList(mTD->Track(itrack), mTD->TrackCharge(itrack)); + } +} + +//-------------------------------------------------------------------------- +void AliMUONDigitizerv2::MakeTransientDigitFromSDigit(Int_t iChamber, AliMUONDigit * sDigit) +{ + Int_t digits[6]; + + + // + // Creating a new TransientDigits from SDigit + digits[0] = sDigit->PadX(); // Padx of the Digit + digits[1] = sDigit->PadY(); // Pady of the Digit + digits[2] = sDigit->Cathode()+1; // Cathode plane + digits[3] = sDigit->Signal(); // Induced charge in the Pad + if (fSignal) digits[4] = sDigit->Signal(); + else digits[4] = 0; + digits[5] = sDigit->Hit(); // Hit number in the list + if (GetDebug()>2) cerr<<"AliMUONDigitizerv2::MakeTransientDigitFromSDigit " << + "PadX "<< digits[0] << " " << + "PadY "<< digits[1] << " " << + "Plane " << digits[2] << " " << + "Charge " << digits[3] <<" " << + "Hit " << digits[5] << endl; + + if (GetDebug()>2) cerr<<"AliMUONDigitizerv2::MakeTransientDigitFromSDigit Creating AliMUONTransientDigit"<AddToTrackList(fMask+sDigit->Track(itrack), sDigit->TrackCharge(itrack)); + } + + if (!ExistTransientDigit(mTD)) { + AddTransientDigit(mTD); + if (GetDebug()>2) cerr<<"AliMUONDigitizerv2::MakeTransientDigitFromSDigit Adding TransientDigit"<2) cerr<<"AliMUONDigitizerv2::MakeTransientDigitFromSDigit updating TransientDigit"<2) Info("Exec","AliMUONDigitizerv2::Exec() starts"); + fTDList = new TObjArray; + + //Loaders (We assume input0 to be the output too) + AliRunLoader * runloader; // Input loader + AliLoader * gime; + + // Getting runloader + runloader = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(0)); + if (runloader == 0x0) { + Error("Exec","RunLoader is not in input file 0"); + return; // RunDigitizer is not working. + } + // Getting MUONloader + gime = runloader->GetLoader("MUONLoader"); + if (gime->TreeS()==0x0) { + if (GetDebug()>2) Info("Exec","TreeS is not loaded yet. Loading..."); + gime->LoadSDigits("READ"); + if (GetDebug()>2) Info("Exec","Now treeS is %#x. MUONLoader is %#x",gime->TreeH(),gime); + } + + if (GetDebug()>2) Info("Exec","Loaders ready"); + + if (runloader->GetAliRun() == 0x0) runloader->LoadgAlice(); + gAlice = runloader->GetAliRun(); + + // Getting Module MUON + AliMUON *pMUON = (AliMUON *) gAlice->GetDetector("MUON"); + if (!pMUON) { + Error("Digitize","Module MUON not found in the input file"); + return; + } + // Getting Muon data + AliMUONData * muondata = pMUON->GetMUONData(); + muondata->SetLoader(gime); + muondata->SetTreeAddress("S"); + + // Loading Event + Int_t currentevent = fManager->GetOutputEventNr(); + + if (GetDebug()>2) cerr<<"AliMUONDigitizerv2::Exec() Event Number is "<GetOutputFolderName()); + //AliLoader * gimeout = runloaderout->GetLoader("MUONLoader"); + // New branch per chamber for MUON digit in the tree of digits + if (gime->TreeD() == 0x0) { + gime->MakeDigitsContainer(); + } + TTree* treeD = gime->TreeD(); + muondata->MakeBranch("D"); + muondata->SetTreeAddress("D"); + + // Array of pointer of the AliMUONHitMapA1: + // two HitMaps per chamber, or one HitMap per cahtode plane + fHitMap= new AliMUONHitMapA1* [2*AliMUONConstants::NCh()]; + + //Loop over chambers for the definition AliMUONHitMap + for (Int_t i=0; iChamber(i)); + c1Segmentation = chamber->SegmentationModel(1); // Cathode plane 1 + fHitMap[i] = new AliMUONHitMapA1(c1Segmentation, fTDList); + c2Segmentation = chamber->SegmentationModel(2); // Cathode plane 2 + fHitMap[i+AliMUONConstants::NCh()] = new AliMUONHitMapA1(c2Segmentation, fTDList); + } + +// Loop over files to merge and to digitize + fSignal = kTRUE; + for (Int_t inputFile=0; inputFileGetNinputs(); inputFile++) { + if (GetDebug()>2) cerr<<"AliMUONDigitizerv2::Exec() Input File is "< 0 ) { + fSignal = kFALSE; + runloader = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inputFile)); + if (runloader == 0x0) { + cerr<<"AliMUONDigitizerv2::Digitize() RunLoader for inputFile "<GetLoader("MUONLoader"); + if (gime->TreeS() == 0x0) gime->LoadSDigits("READ"); + muondata->SetLoader(gime); + muondata->SetTreeAddress("S"); + } + + // Setting the address + TTree *treeS = gime->TreeS(); + if (treeS == 0x0) { + Error("Digitize","Can not get TreeS from input %d",inputFile); + Info("Digitize","Now treeS is %#x. MUONLoader is %#x",gime->TreeS(),gime); + return; + } + if (GetDebug()>2) { + cerr<<"AliMUONDigitizerv2::Exec inputFile is "<2) cerr<<"AliMUONDigitizerv2::Exec Setting tree addresses"<GetMask(inputFile); + // + // Loop over SDigits + Int_t ndig,k; + AliMUONDigit *sDigit; + TClonesArray * muonSDigits; + for (Int_t ich = 0; ich < AliMUONConstants::NCh(); ich++) { // loop over chamber + muondata->ResetSDigits(); + muondata->GetCathodeS(0); + //TClonesArray * + muonSDigits = muondata->SDigits(ich); + ndig = muonSDigits->GetEntriesFast(); +// printf("\n 1 Found %d Sdigits in %p chamber %d", ndig, muonSDigits,ich); + Int_t n = 0; + for (k = 0; k < ndig; k++) { + sDigit = (AliMUONDigit*) muonSDigits->UncheckedAt(k); + MakeTransientDigitFromSDigit(ich,sDigit); + } + muondata->ResetSDigits(); + muondata->GetCathodeS(1); + //TClonesArray * + muonSDigits = muondata->SDigits(ich); + ndig=muonSDigits->GetEntriesFast(); +// printf("\n 2 Found %d Sdigits in %p chamber %d", ndig, muonSDigits,ich); + n = 0; + for (k = 0; k < ndig; k++) { + sDigit = (AliMUONDigit*) muonSDigits->UncheckedAt(k); + MakeTransientDigitFromSDigit(ich,sDigit); + } + + } // SDigits loop end loop over chamber + } // end file loop + if (GetDebug()>2) cerr<<"AliMUONDigitizerv2::Exec End of Sdigits, file loops"<GetEntriesFast(); + Int_t digits[6]; + for (Int_t nent = 0; nent < nentries; nent++) { + AliMUONTransientDigit *address = (AliMUONTransientDigit*)fTDList->At(nent); + if (address == 0) continue; + Int_t ich = address->Chamber(); + Int_t q = address->Signal(); + chamber = &(pMUON->Chamber(ich)); + // + // Digit Response (noise, threshold, saturation, ...) + AliMUONResponse * response = chamber->ResponseModel(); + q = response->DigitResponse(q,address); + + if (!q) continue; + + digits[0] = address->PadX(); + digits[1] = address->PadY(); + digits[2] = address->Cathode()-1; + digits[3] = q; + digits[4] = address->Physics(); + digits[5] = address->Hit(); + + Int_t nptracks = address->GetNTracks(); + + if (nptracks > kMAXTRACKS) { + if (GetDebug() >0) { + cerr<<"AliMUONDigitizer:Exec nptracks > 10 "< 2 && GetDebug() >2) { + cerr<<"AliMUONDigitizer::Exec nptracks > 2 "<GetTrack(tr); + charges[tr] = address->GetCharge(tr); + } //end loop over list of tracks for one pad + // Sort list of tracks according to charge + if (nptracks > 1) { + SortTracks(tracks,charges,nptracks); + } + if (nptracks < kMAXTRACKS ) { + for (Int_t i = nptracks; i < kMAXTRACKS; i++) { + tracks[i] = -1; + charges[i] = 0; + } + } + + // Add digits + if (GetDebug()>3) cerr<<"AliMUONDigitzerv2::Exec TransientDigit to Digit"<AddDigit(ich,tracks,charges,digits); +// printf("test rm ich %d padX %d padY %d \n",ich, digits[0], digits[1]); + } + // Filling list of digits per chamber for a given cathode. + runloader = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); + gime = runloader->GetLoader("MUONLoader"); + muondata->SetLoader(gime); + muondata->Fill("D"); + muondata->ResetDigits(); + } // end loop cathode + fTDList->Delete(); + + for(Int_t ii = 0; ii < 2*AliMUONConstants::NCh(); ++ii) { + if (fHitMap[ii]) { + delete fHitMap[ii]; + fHitMap[ii] = 0; + } + } + + if (GetDebug()>2) + cerr<<"AliMUONDigitizer::Exec: writing the TreeD: " + <GetName()<GetOutputFolderName()); + gime = runloader->GetLoader("MUONLoader"); + gime->WriteDigits("OVERWRITE"); + delete [] fHitMap; + delete fTDList; + muondata->ResetSDigits(); + gime->UnloadSDigits(); + gime->UnloadDigits(); +} +//------------------------------------------------------------------------ +void AliMUONDigitizerv2::SortTracks(Int_t *tracks,Int_t *charges,Int_t ntr) +{ + // + // Sort the list of tracks contributing to a given digit + // Only the 3 most significant tracks are acctually sorted + // + + // + // Loop over signals, only 3 times + // + + Int_t qmax; + Int_t jmax; + Int_t idx[3] = {-2,-2,-2}; + Int_t jch[3] = {-2,-2,-2}; + Int_t jtr[3] = {-2,-2,-2}; + Int_t i,j,imax; + + if (ntr<3) imax=ntr; + else imax=3; + for(i=0;i qmax) { + qmax = charges[j]; + jmax=j; + } + } + + if(qmax > 0) { + idx[i]=jmax; + jch[i]=charges[jmax]; + jtr[i]=tracks[jmax]; + } + + } + + for(i=0;i<3;i++){ + if (jtr[i] == -2) { + charges[i]=0; + tracks[i]=0; + } else { + charges[i]=jch[i]; + tracks[i]=jtr[i]; + } + } +} diff --git a/MUON/AliMUONDigitizerv2.h b/MUON/AliMUONDigitizerv2.h new file mode 100644 index 00000000000..4a2ebfb9883 --- /dev/null +++ b/MUON/AliMUONDigitizerv2.h @@ -0,0 +1,51 @@ +#ifndef ALIMUONDIGITIZERV2_H +#define ALIMUONDIGITIZERV2_H +/* Copyright(c) 1998-2001, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +#include "AliDigitizer.h" +class AliRunDigitizer; +class AliMUONPadHit; +class AliMUONHitMapA1; + +class AliMUONDigitizerv2 : public AliDigitizer { + + public: + AliMUONDigitizerv2(); + AliMUONDigitizerv2(AliRunDigitizer * manager); + virtual ~AliMUONDigitizerv2(); + + // Create a new TransientDigit + virtual void AddTransientDigit(AliMUONTransientDigit * mTD); + // Do the main work + virtual void Exec(Option_t* option=0); + // Verifying a TransientDigit + virtual Bool_t ExistTransientDigit(AliMUONTransientDigit * mTD); + // Getting debug level + Int_t GetDebug() const {return fDebug;} // get debug level + // Initialize merging and digitization + virtual Bool_t Init(); + // Generation of a TransientDigit from SDigit + virtual void MakeTransientDigitFromSDigit(Int_t iChamber, AliMUONDigit * sDigit); + // Setting debug level + void SetDebug(Int_t level){fDebug = level;} // set debug level + enum {kBgTag = -1}; + // Updating a TransientDigit + virtual void UpdateTransientDigit(Int_t /*itrack*/, AliMUONTransientDigit * mTD); + + private: + void SortTracks(Int_t *tracks,Int_t *charges,Int_t ntr); + + private: + AliMUONHitMapA1 **fHitMap; //! pointer to array of pointers to hitmaps + TObjArray *fTDList; //! list of AliMUONTransientDigits + Int_t fTDCounter; //! nr. of AliMUONTransientDigits + Int_t fDebug; //! debug level + Int_t fMask; //! mask dependent on input file + Bool_t fSignal; //! kTRUE if signal file is processed + + + ClassDef(AliMUONDigitizerv2,0) +}; +#endif + diff --git a/MUON/AliMUONSDigitizerv1.cxx b/MUON/AliMUONSDigitizerv1.cxx new file mode 100644 index 00000000000..1a504eadbf0 --- /dev/null +++ b/MUON/AliMUONSDigitizerv1.cxx @@ -0,0 +1,457 @@ + + +#include +#include +#include +#include +#include +#include +#include + +#include "AliMUON.h" +#include "AliMUONChamber.h" +#include "AliMUONConstants.h" +#include "AliMUONDigit.h" +#include "AliMUONSDigitizerv1.h" +#include "AliMUONHit.h" +#include "AliMUONHitMapA1.h" +#include "AliMUONPadHit.h" +#include "AliMUONTransientDigit.h" +#include "AliRun.h" +#include "AliRunLoader.h" +#include "AliLoader.h" + +ClassImp(AliMUONSDigitizerv1) + +//___________________________________________ +AliMUONSDigitizerv1::AliMUONSDigitizerv1() : + fHitMap(0), + fTDList(0), + fTDCounter(0), + fDebug(0), + fMask(0), + fSignal(0) +{ +// Default ctor - don't use it + if (GetDebug()>2) + cerr<<"AliMUONSDigitizerv1::AliMUONSDigitizerv1" + <<"(AliRunDigitizer* manager) was processed"<Chamber() + (mTD->Cathode()-1) * AliMUONConstants::NCh(); + fTDList->AddAtAndExpand(mTD, fTDCounter); + fHitMap[iNchCpl]->SetHit( mTD->PadX(), mTD->PadY(), fTDCounter); + fTDCounter++; +} + +//------------------------------------------------------------------------ +Bool_t AliMUONSDigitizerv1::ExistTransientDigit(AliMUONTransientDigit * mTD) +{ + // Choosing the maping of the cathode plane of the chamber: + Int_t iNchCpl= mTD->Chamber() + (mTD->Cathode()-1) * AliMUONConstants::NCh(); + return( fHitMap[iNchCpl]->TestHit(mTD->PadX(), mTD->PadY()) ); +} + +//------------------------------------------------------------------------ +Bool_t AliMUONSDigitizerv1::Init() +{ + +// Initialization + if (GetDebug()>2) Info("Init","AliMUONSDigitizerv1::Init() starts"); + + //Loaders (We assume input0 to be the output too) + AliRunLoader * runloader; // Input loader + AliLoader * gime; + + // Getting runloader + runloader = AliRunLoader::GetRunLoader(); + if (runloader == 0x0) { + Error("Init","RunLoader is not in input file 0"); + return kFALSE; // RunDigitizer is not working. + } + // Getting MUONloader + gime = runloader->GetLoader("MUONLoader"); + gime->LoadHits("READ"); + gime->LoadSDigits("RECREATE"); + + return kTRUE; +} + +//------------------------------------------------------------------------ +void AliMUONSDigitizerv1::UpdateTransientDigit(Int_t track, AliMUONTransientDigit * mTD) +{ + // Choosing the maping of the cathode plane of the chamber: + Int_t iNchCpl= mTD->Chamber() + (mTD->Cathode()-1) * AliMUONConstants::NCh(); + AliMUONTransientDigit *pdigit = + static_cast(fHitMap[iNchCpl]->GetHit(mTD->PadX(),mTD->PadY())); + // update charge + // + Int_t iqpad = mTD->Signal(); // charge per pad + pdigit->AddSignal(iqpad); + pdigit->AddPhysicsSignal(iqpad); + // update list of tracks + // + Int_t charge; + track=+ fMask; + if (fSignal) charge = iqpad; + //else charge = kBgTag; + else charge = iqpad + fMask; + + pdigit->UpdateTrackList(track,charge); +} + + +//-------------------------------------------------------------------------- +void AliMUONSDigitizerv1::MakeTransientDigit(Int_t track, Int_t iHit, AliMUONHit * mHit) +{ + AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); + if (!pMUON) { + cerr<<"AliMUONSDigitizerv1::MakeTransientDigit Error:" + <<" module MUON not found in the input file"<2) cerr<<"AliMUONSDigitizerv1::MakeTransientDigit starts"<Chamber()-1; + AliMUONChamber & chamber = pMUON->Chamber(ichamber); + Float_t xhit = mHit->X(); + Float_t yhit = mHit->Y(); + Float_t zhit = mHit->Z(); + Float_t eloss= mHit->Eloss(); + Float_t tof = mHit->Age(); + // Variables for chamber response from AliMUONChamber::DisIntegration + Float_t newdigit[6][500]; // Pad information + Int_t nnew=0; // Number of touched Pads per hit + Int_t digits[6]; + + // + // Calls the charge disintegration method of the current chamber + if (GetDebug()>2) cerr<<"AliMUONSDigitizerv1::MakeTransientDigit calling AliMUONChamber::DisIngtegration starts"<2) cerr<<"AliMUONSDigitizerv1::MakeTransientDigit " << + cerr<<"AliMUONSDigitizerv1::MakeTransientDigit " << + "PadX "<< digits[0] << " " << + "PadY "<< digits[1] << " " << + "Plane " << digits[2] << " " << + "Charge " << digits[3] <<" " << + "newdigit " << newdigit[3][iTD] <<" " << + "Hit " << digits[5] << endl; + // list of tracks + Int_t charge; + track += fMask; + if (fSignal) charge = digits[3]; + //else charge = kBgTag; + else charge = digits[3] + fMask; + + if (GetDebug()>2) cerr<<"AliMUONSDigitizerv1::MakeTransientDigit Creating AliMUONTransientDigit"<AddToTrackList(track,charge); + if (!ExistTransientDigit(mTD)) { + AddTransientDigit(mTD); + if (GetDebug()>2) cerr<<"AliMUONSDigitizerv1::MakeTransientDigit Adding TransientDigit"<2) cerr<<"AliMUONSDigitizerv1::MakeTransientDigit updating TransientDigit"<2) Info("SDigitize","AliMUONSDigitizerv1::Exec starts"); + fTDList = new TObjArray; + + //Loaders (We assume input0 to be the output too) + AliRunLoader * runloader; // Input loader + AliLoader * gime; + + // Getting runloader + runloader = AliRunLoader::GetRunLoader(); + if (runloader == 0x0) { + Error("SDigitize","RunLoader is not in input file 0"); + return; // RunDigitizer is not working. + } + // Getting MUONloader + gime = runloader->GetLoader("MUONLoader"); + if (gime->TreeH()==0x0) { + if (GetDebug()>2) Info("SDigitize","TreeH is not loaded yet. Loading..."); + gime->LoadHits("READ"); + if (GetDebug()>2) Info("SDigitize","Now treeH is %#x. MUONLoader is %#x",gime->TreeH(),gime); + } + + if (GetDebug()>2) Info("SDigitize","Loaders ready"); + + if (runloader->GetAliRun() == 0x0) runloader->LoadgAlice(); + gAlice = runloader->GetAliRun(); + + // Getting Module MUON + AliMUON *pMUON = (AliMUON *) gAlice->GetDetector("MUON"); + if (!pMUON) { + Error("SDigitize","Module MUON not found in the input file"); + return; + } + // Getting Muon data + AliMUONData * muondata = pMUON->GetMUONData(); + muondata->SetLoader(gime); + muondata->SetTreeAddress("H"); + + Int_t currentevent = runloader->GetEventNumber(); + + if (GetDebug()>2) cerr<<"AliMUONSDigitizerv1::Exec Event Number is "<TreeS() == 0x0) { + gime->MakeSDigitsContainer(); + } + TTree* treeS = gime->TreeS(); + muondata->MakeBranch("S"); + muondata->SetTreeAddress("S"); + + // Array of pointer of the AliMUONHitMapA1: + // two HitMaps per chamber, or one HitMap per cahtode plane + fHitMap= new AliMUONHitMapA1* [2*AliMUONConstants::NCh()]; + + //Loop over chambers for the definition AliMUONHitMap + for (Int_t i=0; iChamber(i)); + c1Segmentation = chamber->SegmentationModel(1); // Cathode plane 1 + fHitMap[i] = new AliMUONHitMapA1(c1Segmentation, fTDList); + c2Segmentation = chamber->SegmentationModel(2); // Cathode plane 2 + fHitMap[i+AliMUONConstants::NCh()] = new AliMUONHitMapA1(c2Segmentation, fTDList); + } + +// Loop to Sdigitize + fSignal = kTRUE; + + // Setting the address + TTree *treeH = gime->TreeH(); + if (treeH == 0x0) { + Error("SDigitize","Can not get TreeH from input "); + Info("SDigitize","Now treeH is %#x. MUONLoader is %#x",gime->TreeH(),gime); + return; + } + if (GetDebug()>2) { + cerr<<"AliMUONSDigitizerv1::Exec treeH" << treeH <2) cerr<<"AliMUONSDigitizerv1::Exec Setting tree addresses"<GetEntries(); + for (itrack = 0; itrack < ntracks; itrack++) { + if (GetDebug()>2) cerr<<"AliMUONSDigitizerv1::Exec itrack = "<ResetHits(); + treeH->GetEvent(itrack); + // + // Loop over hits + Int_t ihit, ichamber; + AliMUONHit* mHit; + TClonesArray* hits = muondata->Hits(); + for(ihit = 0; ihit < hits->GetEntriesFast(); ihit++) { + mHit = static_cast(hits->At(ihit)); + ichamber = mHit->Chamber()-1; // chamber number + if (ichamber > AliMUONConstants::NCh()-1) { + cerr<<"AliMUONSDigitizer: ERROR: " + <<"fNch > AliMUONConstants::NCh()-1, fNch, NCh(): " + <Chamber(ichamber)); + // + //Dumping Hit content: + if (GetDebug()>2) { + cerr<<"AliMuonDigitizerv1::Exec ihit, ichamber, x, y, z, eloss " << + ihit << " " << + mHit->Chamber() << " " << + mHit->X() << " " << + mHit->Y() << " " << + mHit->Z() << " " << + mHit->Eloss() << " " << endl; + } + // + // Inititializing Correlation + chamber->ChargeCorrelationInit(); + if (ichamber < AliMUONConstants::NTrackingCh()) { + // Tracking Chamber + // Initialize hit position (cursor) in the segmentation model + chamber->SigGenInit(mHit->X(), mHit->Y(), mHit->Z()); + } else { + // Trigger Chamber + } + MakeTransientDigit(itrack, ihit, mHit); + } // hit loop + } // track loop + if (GetDebug()>2) cerr<<"AliMUONSDigitizer::Exec End of hits, track and file loops"<GetEntriesFast(); + Int_t digits[6]; + for (Int_t nent = 0; nent < nentries; nent++) { + AliMUONTransientDigit *address = (AliMUONTransientDigit*)fTDList->At(nent); + if (address == 0) continue; + Int_t ich = address->Chamber(); + Int_t q = address->Signal(); + + if (!q) continue; // not mandatory ? + + digits[0] = address->PadX(); + digits[1] = address->PadY(); + digits[2] = address->Cathode()-1; + digits[3] = q; + digits[4] = address->Physics(); + digits[5] = address->Hit(); + + Int_t nptracks = address->GetNTracks(); + + if (nptracks > kMAXTRACKS) { + if (GetDebug() >0) { + cerr<<"AliMUONSDigitizer:Exec nptracks > 10 "< 2 && GetDebug() >2) { + cerr<<"AliMUONSDigitizer::Exec nptracks > 2 "<GetTrack(tr); + charges[tr] = address->GetCharge(tr); + } //end loop over list of tracks for one pad + // Sort list of tracks according to charge + if (nptracks > 1) { + SortTracks(tracks,charges,nptracks); + } + if (nptracks < kMAXTRACKS ) { + for (Int_t i = nptracks; i < kMAXTRACKS; i++) { + tracks[i] = -1; + charges[i] = 0; + } + } + + // Add Sdigits + if (GetDebug()>3) cerr<<"AliMUONSDigitzerv1::Exec TransientDigit to SDigit"<AddSDigit(ich,tracks,charges,digits); +// printf("test rm ich %d padX %d padY %d \n",ich, digits[0], digits[1]); + } + // Filling list of Sdigits per chamber for a given cathode. + muondata->Fill("S"); + muondata->ResetSDigits(); + } // end loop cathode + fTDList->Delete(); + + for(Int_t ii = 0; ii < 2*AliMUONConstants::NCh(); ++ii) { + if (fHitMap[ii]) { + delete fHitMap[ii]; + fHitMap[ii] = 0; + } + } + + if (GetDebug()>2) + cerr<<"AliMUONSDigitizer::Exec: writing the TreeS: " + <GetName()<GetLoader("MUONLoader"); + gime->WriteSDigits("OVERWRITE"); + delete [] fHitMap; + delete fTDList; + muondata->ResetHits(); + gime->UnloadHits(); + gime->UnloadSDigits(); +} +//------------------------------------------------------------------------ +void AliMUONSDigitizerv1::SortTracks(Int_t *tracks,Int_t *charges,Int_t ntr) +{ + // + // Sort the list of tracks contributing to a given Sdigit + // Only the 3 most significant tracks are acctually sorted + // + + // + // Loop over signals, only 3 times + // + + Int_t qmax; + Int_t jmax; + Int_t idx[3] = {-2,-2,-2}; + Int_t jch[3] = {-2,-2,-2}; + Int_t jtr[3] = {-2,-2,-2}; + Int_t i,j,imax; + + if (ntr<3) imax=ntr; + else imax=3; + for(i=0;i qmax) { + qmax = charges[j]; + jmax=j; + } + } + + if(qmax > 0) { + idx[i]=jmax; + jch[i]=charges[jmax]; + jtr[i]=tracks[jmax]; + } + + } + + for(i=0;i<3;i++){ + if (jtr[i] == -2) { + charges[i]=0; + tracks[i]=0; + } else { + charges[i]=jch[i]; + tracks[i]=jtr[i]; + } + } +} diff --git a/MUON/AliMUONSDigitizerv1.h b/MUON/AliMUONSDigitizerv1.h new file mode 100644 index 00000000000..e4584759bc2 --- /dev/null +++ b/MUON/AliMUONSDigitizerv1.h @@ -0,0 +1,50 @@ +#ifndef ALIMUONSDIGITIZERV1_H +#define ALIMUONSDIGITIZERV1_H + +// The AliMUONSDigitizer produces +// SDigits from Hits +// J.P Cussonneau Subatech Feb 2004 + +class AliMUONPadHit; +class AliMUONHitMapA1; + +class AliMUONSDigitizerv1 { + + public: + AliMUONSDigitizerv1(); + virtual ~AliMUONSDigitizerv1(); + + // Create a new TransientDigit + virtual void AddTransientDigit(AliMUONTransientDigit * mTD); + // Do the main work + virtual void Exec(Option_t* option=0); + // Verifying a TransientDigit + virtual Bool_t ExistTransientDigit(AliMUONTransientDigit * mTD); + // Getting debug level + Int_t GetDebug() const {return fDebug;} // get debug level + // Initialize merging and digitization + virtual Bool_t Init(); + // Generation of a TransientDigit : Response function of the chamber + virtual void MakeTransientDigit(Int_t itrack, Int_t ihit, AliMUONHit * mHit); + // Setting debug level + void SetDebug(Int_t level){fDebug = level;} // set debug level + enum {kBgTag = -1}; + // Updating a TransientDigit + virtual void UpdateTransientDigit(Int_t itrack, AliMUONTransientDigit * mTD); + + private: + void SortTracks(Int_t *tracks,Int_t *charges,Int_t ntr); + + private: + AliMUONHitMapA1 **fHitMap; //! pointer to array of pointers to hitmaps + TObjArray *fTDList; //! list of AliMUONTransientDigits + Int_t fTDCounter; //! nr. of AliMUONTransientDigits + Int_t fDebug; //! debug level + Int_t fMask; //! mask dependent on input file + Bool_t fSignal; //! kTRUE if signal file is processed + + + ClassDef(AliMUONSDigitizerv1,0) +}; +#endif + diff --git a/MUON/MUONHit2SDigit.C b/MUON/MUONHit2SDigit.C new file mode 100644 index 00000000000..65f891ffd17 --- /dev/null +++ b/MUON/MUONHit2SDigit.C @@ -0,0 +1,55 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + + +#if !defined(__CINT__) || defined(__MAKECINT__) +#include + +#include "AliRun.h" +#include "AliMUON.h" +#include "AliMUONData.h" +#endif + +void MUONHit2SDigit(Int_t iEveMin, Int_t iEveMax, Text_t *FileName = "galice.root") +{ + // + cout << "MUONSDigitTest" << endl; + cout << "FileName ``" << FileName << "''" << endl; + + // Creating Run Loader and openning file containing Hits, Digits and RecPoints + AliRunLoader * RunLoader = AliRunLoader::Open(FileName,"Event","UPDATE"); + if (RunLoader ==0x0) { + printf(">>> Error : Error Opening %s file \n",FileName); + return; + } + // Loading AliRun master + RunLoader->LoadgAlice(); + gAlice = RunLoader->GetAliRun(); + AliLoader * gime; + gime = RunLoader->GetLoader("MUONLoader"); + + gime->LoadHits("READ"); + gime->LoadSDigits("RECREATE"); + + // Loading MUON subsystem + AliMUON* MUON = (AliMUON *) gAlice->GetDetector("MUON"); + + Int_t nEvents = RunLoader->GetNumberOfEvents(); + Int_t nEveMax = TMath::Min(iEveMax,nEvents-1); + for (Int_t iEvent = iEveMin; iEvent <= nEveMax; iEvent++){ + RunLoader->GetEvent(iEvent); + MUON->Hits2SDigits(); + } +} diff --git a/MUON/MUONLinkDef.h b/MUON/MUONLinkDef.h index 8fb62d8c8b0..72cec1e66c6 100644 --- a/MUON/MUONLinkDef.h +++ b/MUON/MUONLinkDef.h @@ -33,13 +33,13 @@ #pragma link C++ class AliMUONChamberTrigger+; #pragma link C++ class AliMUONPoints+; #pragma link C++ class AliMUONDisplay+; +#pragma link C++ class AliMUONClusterReconstructor+; #pragma link C++ class AliMUONClusterFinderVS+; #pragma link C++ class AliMUONHitMapA1+; #pragma link C++ class AliMUONTriggerCircuit+; #pragma link C++ class AliMUONTriggerLut+; #pragma link C++ class AliMUONTriggerDecision+; #pragma link C++ class AliMUONEventReconstructor+; -#pragma link C++ class AliMUONClusterReconstructor+; #pragma link C++ class AliMUONHitForRec+; #pragma link C++ class AliMUONSegment+; #pragma link C++ class AliMUONTrack+; @@ -60,6 +60,8 @@ #pragma link C++ class AliMUONFactory+; #pragma link C++ class AliMUONDigitizer+; #pragma link C++ class AliMUONDigitizerv1+; +#pragma link C++ class AliMUONDigitizerv2+; +#pragma link C++ class AliMUONSDigitizerv1+; #pragma link C++ class AliMUONTrackK+; #pragma link C++ class AliMUONPixel+; #pragma link C++ class AliMUONClusterFinderAZ+; diff --git a/MUON/libMUON.pkg b/MUON/libMUON.pkg index b1b3fe5f57e..1edc1b0bc7a 100644 --- a/MUON/libMUON.pkg +++ b/MUON/libMUON.pkg @@ -15,13 +15,12 @@ SRCS = AliMUONChamber.cxx AliMUONChamberTrigger.cxx \ AliMUONSt2GeometryBuilder.cxx AliMUONSlatGeometryBuilder.cxx \ AliMUONTriggerGeometryBuilder.cxx \ AliMUONDisplay.cxx AliMUONPoints.cxx \ - AliMUONClusterFinderVS.cxx \ + AliMUONClusterReconstructor.cxx AliMUONClusterFinderVS.cxx \ AliMUONHitMapA1.cxx \ AliMUONHit.cxx AliMUONPadHit.cxx AliMUONDigit.cxx \ AliMUONTransientDigit.cxx AliMUONRawCluster.cxx \ AliMUONReconstHit.cxx \ AliMUONEventReconstructor.cxx \ - AliMUONClusterReconstructor.cxx \ AliMUONTriggerDecision.cxx \ AliMUONHitForRec.cxx AliMUONSegment.cxx \ AliMUONTrack.cxx AliMUONTriggerTrack.cxx \ @@ -33,7 +32,7 @@ SRCS = AliMUONChamber.cxx AliMUONChamberTrigger.cxx \ AliMUONSegmentationSlatModule.cxx AliMUONSegmentationSlatModuleN.cxx \ AliMUONSegmentationSlat.cxx AliMUONSegmentationSlatN.cxx \ AliMUONRecoEvent.cxx AliMUONRecoDisplay.cxx \ - AliMUONMerger.cxx AliMUONFactory.cxx AliMUONDigitizer.cxx AliMUONDigitizerv1.cxx \ + AliMUONMerger.cxx AliMUONFactory.cxx AliMUONDigitizer.cxx AliMUONDigitizerv1.cxx AliMUONDigitizerv2.cxx AliMUONSDigitizerv1.cxx \ AliMUONTrackK.cxx AliMUONClusterFinderAZ.cxx AliMUONPixel.cxx \ AliMUONLoader.cxx AliMUONData.cxx -- 2.39.3