From: martinez Date: Mon, 8 Sep 2003 15:10:27 +0000 (+0000) Subject: Tracks reconstruction using NewIO X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=dcd2690d673b71b1cd969b5a48f1902d20442ac6 Tracks reconstruction using NewIO --- diff --git a/MUON/AliMUONData.cxx b/MUON/AliMUONData.cxx index 3636309f432..c3099605687 100644 --- a/MUON/AliMUONData.cxx +++ b/MUON/AliMUONData.cxx @@ -9,6 +9,7 @@ #include "AliMUONLocalTrigger.h" #include "AliMUONGlobalTrigger.h" #include "AliMUONRawCluster.h" +#include "AliMUONTrack.h" ClassImp(AliMUONData) @@ -21,7 +22,8 @@ AliMUONData::AliMUONData():TNamed() fNdigits = 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 + fLocalTrigger = 0x0; //! List of Local Trigger, 1st event in TreeR/LocalTriggerBranch + fRecTracks = 0x0; //default constructor } //_____________________________________________________________________________ @@ -47,6 +49,8 @@ AliMUONData::AliMUONData(AliLoader * loader, const char* name, const char* title fNglobaltrigger =0; fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234); fNlocaltrigger = 0; + fRecTracks = new TClonesArray("AliMUONTrack", 10); + fNrectracks = 0; // really needed or GetEntriesFast sufficient ???? //default constructor } //_____________________________________________________________________________ @@ -78,6 +82,10 @@ AliMUONData::~AliMUONData() fLocalTrigger->Delete(); delete fLocalTrigger; } + if (fRecTracks){ + fRecTracks->Delete(); + delete fRecTracks; + } //detructor } //_____________________________________________________________________________ @@ -127,6 +135,15 @@ void AliMUONData::AddRawCluster(Int_t id, const AliMUONRawCluster& c) TClonesArray &lrawcl = *((TClonesArray*) fRawClusters->At(id)); new(lrawcl[fNrawclusters[id]++]) AliMUONRawCluster(c); } +//_____________________________________________________________________________ +void AliMUONData::AddRecTrack(const AliMUONTrack& track) +{ + // + // Add a MUON rectrack + // + TClonesArray &lrectracks = *fRecTracks; + new(lrectracks[fNrectracks++]) AliMUONTrack(track); +} //____________________________________________________________________________ void AliMUONData::MakeBranch(Option_t* option) { @@ -257,10 +274,20 @@ void AliMUONData::MakeBranch(Option_t* option) Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname); } - if (TreeR() && cRT ) { - Info("MakeBranch","Making Branch for TreeT is not yet ready. \n"); - } - if (TreeR() && cRP ) { + if (TreeT() && cRT ) { + if (fRecTracks == 0x0) fRecTracks = new TClonesArray("AliMUONTrack",10); + fNrectracks = 0; + sprintf(branchname,"%sTrack",GetName()); + branch = TreeT()->GetBranch(branchname); + if (branch) { + Info("MakeBranch","Branch %s is already in tree.",GetName()); + return ; + } + branch = TreeT()->Branch(branchname,&fRecTracks,kBufferSize); + Info("MakeBranch","Making Branch %s for tracks \n",branchname); + } + + if (TreeP() && cRP ) { Info("MakeBranch","Making Branch for TreeP is not yet ready. \n"); } } @@ -303,6 +330,13 @@ void AliMUONData::ResetTrigger() fNlocaltrigger = 0; if (fLocalTrigger) fLocalTrigger->Clear(); } +//____________________________________________________________________________ +void AliMUONData::ResetRecTracks() +{ + // Reset tracks information + fNrectracks = 0; + if (fRecTracks) fRecTracks->Clear(); +} //_____________________________________________________________________________ void AliMUONData::SetTreeAddress(Option_t* option) { @@ -310,7 +344,7 @@ void AliMUONData::SetTreeAddress(Option_t* option) const char *cD = strstr(option,"D"); // Digits branches in TreeD 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 + const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP // Set branch address for the Hits, Digits, RawClusters, GlobalTrigger and LocalTrigger Tree. @@ -399,5 +433,12 @@ void AliMUONData::SetTreeAddress(Option_t* option) if (branch) branch->SetAddress(&fGlobalTrigger); else Warning("SetTreeAddress","(%s) Failed for LocalTrigger. Can not find branch in tree.",GetName()); } + + if ( TreeT() && fRecTracks && cRT ) { + sprintf(branchname,"%sTrack",GetName()); + branch = TreeT()->GetBranch(branchname); + if (branch) branch->SetAddress(&fRecTracks); + else Warning("SetTreeAddress","(%s) Failed for Tracks. Can not find branch in tree.",GetName()); + } } //_____________________________________________________________________________ diff --git a/MUON/AliMUONData.h b/MUON/AliMUONData.h index 3ed04b55ede..b0dadf730b8 100644 --- a/MUON/AliMUONData.h +++ b/MUON/AliMUONData.h @@ -16,6 +16,7 @@ class TObjArray; class TTree; class AliMUONRawCluster; +class AliMUONTrack; //__________________________________________________________________ ///////////////////////////////////////////////////////////////////// @@ -41,6 +42,8 @@ class AliMUONData : public TNamed { Int_t *pairLike); virtual void AddLocalTrigger(Int_t* ltrigger); virtual void AddRawCluster(Int_t id, const AliMUONRawCluster& clust); + virtual void AddRecTrack(const AliMUONTrack& track); + TClonesArray* Hits() {return fHits;} TClonesArray* Digits(Int_t DetectionPlane, Int_t /*Cathode*/) {return ( (TClonesArray*) fDigits->At(DetectionPlane) );} @@ -48,17 +51,19 @@ class AliMUONData : public TNamed { TClonesArray* GlobalTrigger() {return fGlobalTrigger;} TClonesArray* RawClusters(Int_t DetectionPlane) {return ( (TClonesArray*) fRawClusters->At(DetectionPlane) );} - + TClonesArray* RecTracks() {return fRecTracks;} + virtual AliLoader* GetLoader() {return fLoader;} virtual void SetLoader(AliLoader * loader) {fLoader=loader;} - + virtual void MakeBranch(Option_t *opt=" "); virtual void SetTreeAddress(Option_t *opt=" "); - + virtual void ResetHits(); virtual void ResetDigits(); virtual void ResetTrigger(); virtual void ResetRawClusters(); + virtual void ResetRecTracks(); TTree* TreeH() {return fLoader->TreeH(); } TTree* TreeD() {return fLoader->TreeD(); } @@ -74,16 +79,25 @@ class AliMUONData : public TNamed { protected: AliLoader* fLoader; - TClonesArray* fHits; // One event in treeH per primary track - TObjArray* fDigits; // One event in treeD 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 + // One event in treeH per primary track + TClonesArray* fHits; + // One event in treeD and one branch per detection plane + TObjArray* fDigits; + //One event in TreeR/Rawcluster and one branch per tracking detection plane + TObjArray* fRawClusters; + //! List of Global Trigger One event in TreeR/GlobalTriggerBranch + TClonesArray* fGlobalTrigger; + //! List of Local Trigger, One event in TreeR/LocalTriggerBranch + TClonesArray* fLocalTrigger; + // pointer to array of reconstructed tracks + TClonesArray* fRecTracks; + Int_t fNhits; Int_t* fNdigits; Int_t* fNrawclusters; Int_t fNglobaltrigger; Int_t fNlocaltrigger; + Int_t fNrectracks; ClassDef(AliMUONData,1) }; diff --git a/MUON/AliMUONEventReconstructor.cxx b/MUON/AliMUONEventReconstructor.cxx index 19650b19162..d1025adf685 100644 --- a/MUON/AliMUONEventReconstructor.cxx +++ b/MUON/AliMUONEventReconstructor.cxx @@ -715,9 +715,6 @@ void AliMUONEventReconstructor::AddHitsForRecFromRawClusters(TTree* TR) // Loading MUON subsystem AliMUON * pMUON = (AliMUON *) gAlice->GetDetector("MUON"); - // AliMUON *pMUON = (AliMUON*) gAlice->GetModule("MUON"); // necessary ???? - // Security on MUON ???? - //pMUON->ResetRawClusters(); nTRentries = Int_t(TR->GetEntries()); if (nTRentries != 1) { cout << "Error in AliMUONEventReconstructor::AddHitsForRecFromRawClusters" diff --git a/MUON/README b/MUON/README index 6f539f349a8..05a82de575b 100644 --- a/MUON/README +++ b/MUON/README @@ -13,7 +13,6 @@ root [0] gAlice->Run(10,"$ALICE_ROOT/MUON/Config_MUON_test.C"); acceptance will be simulated using geant3. Hit information will be store in the root file in the execution directory. - If you want to change the option or to define a new directory for hits, you have to do the following before: root [0] gAlice->SetConfigFunction("Config( \"/home/martinez/aliroot/work_NewIO/test/\" , \"box\" );"); @@ -54,7 +53,7 @@ MUONtrigger("galice.root",0,10); First event and last event are given by hand, but this will change. ============================================================ - How to run MUON Tracking reconstruction + How to run MUON Tracking reconstruction (old output) =========================================================== .includepath $ALICE_ROOT/STEER .includepath $ALICE_ROOT/MUON @@ -63,6 +62,17 @@ MUONrecoNtuple(0,10,0,"galice.root") First event and last event are given by hand, but this will change. +=========================================================== + How to run MUON Tracking reconstruction (new output) +=========================================================== +.includepath $ALICE_ROOT/STEER +.includepath $ALICE_ROOT/MUON +.L $ALICE_ROOT/MUON/MUONTracker.C++ +MUONTracker(0,10,"galice.root") + +Output in MUON.Tracks.root using the new IO +as a TClonesArray of AliMUONTrack + ============================================================ How to run MUONCheck macro ============================================================