X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUON.cxx;h=8b3bd03b8eb396bd862214e2db6b89e5c2b624b1;hb=f2649dd2a600ac50f4a40d9042b71d7194353e97;hp=dbd928e756e295db4b4a8a9796d2f8acde131974;hpb=d963c26159ea92c48a76b3521538812aec23b057;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUON.cxx b/MUON/AliMUON.cxx index dbd928e756e..8b3bd03b8eb 100644 --- a/MUON/AliMUON.cxx +++ b/MUON/AliMUON.cxx @@ -12,242 +12,70 @@ * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -Revision 1.51 2001/05/31 10:19:52 morsch -Fix for new AliRun::RunReco(). - -Revision 1.50 2001/05/16 14:57:17 alibrary -New files for folders and Stack - -Revision 1.49 2001/03/12 17:45:48 hristov -Changes needed on Sun with CC 5.0 - -Revision 1.48 2001/03/06 00:01:36 morsch -Add Digits2Reco() and FindClusters() -Adapt call of cluster finder to new STEER. - -Revision 1.47 2001/03/05 08:38:36 morsch -Digitization related methods moved to AliMUONMerger. - -Revision 1.46 2001/01/26 21:34:59 morsch -Use access functions for AliMUONHit, AliMUONDigit and AliMUONPadHit data members. - -Revision 1.45 2001/01/26 20:00:49 hristov -Major upgrade of AliRoot code - -Revision 1.44 2001/01/25 17:39:09 morsch -Pass size of fNdch and fNrawch to CINT. - -Revision 1.43 2001/01/23 18:58:19 hristov -Initialisation of some pointers - -Revision 1.42 2001/01/17 20:53:40 hristov -Destructors corrected to avoid memory leaks - -Revision 1.41 2000/12/21 22:12:40 morsch -Clean-up of coding rule violations, - -Revision 1.40 2000/11/29 20:32:26 gosset -Digitize: -1. correction for array index out of bounds -2. one printout commented - -Revision 1.39 2000/11/12 17:17:03 pcrochet -BuildGeometry of AliMUON for trigger chambers delegated to AliMUONSegmentationTriggerX (same strategy as for tracking chambers) - -Revision 1.38 2000/11/06 09:20:43 morsch -AliMUON delegates part of BuildGeometry() to AliMUONSegmentation using the -Draw() method. This avoids code and parameter replication. - -Revision 1.37 2000/10/26 09:53:37 pcrochet -put back trigger chambers in the display (there was a problem in buildgeometry) - -Revision 1.36 2000/10/25 19:51:18 morsch -Correct x-position of chambers. - -Revision 1.35 2000/10/24 19:46:21 morsch -BuildGeometry updated for slats in station 3-4. - -Revision 1.34 2000/10/18 11:42:06 morsch -- AliMUONRawCluster contains z-position. -- Some clean-up of useless print statements during initialisations. - -Revision 1.33 2000/10/09 14:01:57 morsch -Unused variables removed. - -Revision 1.32 2000/10/06 09:08:10 morsch -Built geometry includes slat geometry for event display. - -Revision 1.31 2000/10/02 21:28:08 fca -Removal of useless dependecies via forward declarations - -Revision 1.30 2000/10/02 16:58:29 egangler -Cleaning of the code : --> coding conventions --> void Streamers --> some useless includes removed or replaced by "class" statement - -Revision 1.29 2000/07/28 13:49:38 morsch -SetAcceptance defines inner and outer chamber radii according to angular acceptance. -Can be used for simple acceptance studies. - -Revision 1.28 2000/07/22 16:43:15 morsch -Same comment as before, but now done correctly I hope (sorry it's Saturday evening) - -Revision 1.27 2000/07/22 16:36:50 morsch -Change order of indices in creation (new) of xhit and yhit - -Revision 1.26 2000/07/03 11:54:57 morsch -AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER -The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC. - -Revision 1.25 2000/06/29 12:34:09 morsch -AliMUONSegmentation class has been made independent of AliMUONChamber. This makes -it usable with any other geometry class. The link to the object to which it belongs is -established via an index. This assumes that there exists a global geometry manager -from which the pointer to the parent object can be obtained (in our case gAlice). - -Revision 1.24 2000/06/28 15:16:35 morsch -(1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there) -to allow development of slat-muon chamber simulation and reconstruction code in the MUON -framework. The changes should have no side effects (mostly dummy arguments). -(2) Hit disintegration uses 3-dim hit coordinates to allow simulation -of chambers with overlapping modules (MakePadHits, Disintegration). - -Revision 1.23 2000/06/28 12:19:17 morsch -More consequent seperation of global input data services (AliMUONClusterInput singleton) and the -cluster and hit reconstruction algorithms in AliMUONClusterFindRawinderVS. -AliMUONClusterFinderVS becomes the base class for clustering and hit reconstruction. -It requires two cathode planes. Small modifications in the code will make it usable for -one cathode plane and, hence, more general (for test beam data). -AliMUONClusterFinder is now obsolete. - -Revision 1.22 2000/06/28 08:06:10 morsch -Avoid global variables in AliMUONClusterFinderVS by seperating the input data for the fit from the -algorithmic part of the class. Input data resides inside the AliMUONClusterInput singleton. -It also naturally takes care of the TMinuit instance. - -Revision 1.21 2000/06/27 08:54:41 morsch -Problems with on constant array sizes (in hitMap, nmuon, xhit, yhit) corrected. - -Revision 1.20 2000/06/26 14:02:38 morsch -Add class AliMUONConstants with MUON specific constants using static memeber data and access methods. - -Revision 1.19 2000/06/22 13:40:51 morsch -scope problem on HP, "i" declared once -pow changed to TMath::Power (PH, AM) - -Revision 1.18 2000/06/15 07:58:48 morsch -Code from MUON-dev joined - -Revision 1.14.4.17 2000/06/14 14:36:46 morsch -- add TriggerCircuit (PC) -- add GlobalTrigger and LocalTrigger and specific methods (PC) - -Revision 1.14.4.16 2000/06/09 21:20:28 morsch -Most coding rule violations corrected - -Revision 1.14.4.15 2000/05/02 09:54:32 morsch -RULE RN17 violations corrected - -Revision 1.14.4.12 2000/04/26 12:25:02 morsch -Code revised by P. Crochet: -- Z position of TriggerChamber changed according to A.Tournaire Priv.Comm. -- ToF included in the method MakePadHits -- inner radius of flange between beam shielding and trigger corrected -- Trigger global volume updated (according to the new geometry) - -Revision 1.14.4.11 2000/04/19 19:42:08 morsch -Some changes of variable names curing viols and methods concerning -correlated clusters removed. - -Revision 1.14.4.10 2000/03/22 16:44:07 gosset -Memory leak suppressed in function Digitise: -p_adr->Delete() instead of Clear (I.Chevrot and A.Baldisseri) - -Revision 1.14.4.9 2000/03/20 18:15:25 morsch -Positions of trigger chambers corrected (P.C.) - -Revision 1.14.4.8 2000/02/21 15:38:01 morsch -Call to AddHitList introduced to make this version compatible with head. - -Revision 1.14.4.7 2000/02/20 07:45:53 morsch -Bugs in Trigger part of BuildGeomemetry corrected (P.C) - -Revision 1.14.4.6 2000/02/17 14:28:54 morsch -Trigger included into initialization and digitization -Revision 1.14.4.5 2000/02/15 10:02:58 morsch -Log messages of previous revisions added - -Revision 1.14.4.2 2000/02/04 10:57:34 gosset -Z position of the chambers: -it was the Z position of the stations; -it is now really the Z position of the chambers. - !!!! WARNING: THE CALLS TO "AliMUONChamber::SetZPOS" - !!!! AND "AliMUONChamber::ZPosition" - !!!! HAVE TO BE CHANGED TO "AliMUONChamber::"SetZ" - !!!! AND "AliMUONChamber::Z" - -Revision 1.14.4.3 2000/02/04 16:19:04 gosset -Correction for mis-spelling of NCH - -Revision 1.14.4.4 2000/02/15 09:43:38 morsch -Log message added - -*/ +/* $Id$ */ /////////////////////////////////////////////// // Manager and hits classes for set:MUON // //////////////////////////////////////////////// -#include +#include "Riostream.h" + +#include #include -#include +#include +#include +#include #include +#include #include -#include -#include -#include -#include +#include #include -#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include +#include +#include +#include +#include "AliConst.h" +#include "AliHeader.h" +#include "AliHitMap.h" +#include "AliLoader.h" +#include "AliESD.h" +#include "AliESDMuonTrack.h" +#include "AliMUONLoader.h" #include "AliMUON.h" +#include "AliMUONTriggerTrack.h" +#include "AliMUONEventReconstructor.h" +#include "AliMUONTrack.h" +#include "AliMUONTrackParam.h" +#include "AliMUONChamberTrigger.h" +#include "AliMUONClusterFinderVS.h" +#include "AliMUONClusterInput.h" +#include "AliMUONConstants.h" +#include "AliMUONDigit.h" +#include "AliMUONGlobalTrigger.h" #include "AliMUONHit.h" +#include "AliMUONHitMapA1.h" +#include "AliMUONLocalTrigger.h" +#include "AliMUONMerger.h" #include "AliMUONPadHit.h" -#include "AliMUONDigit.h" -#include "AliMUONTransientDigit.h" #include "AliMUONRawCluster.h" -#include "AliMUONLocalTrigger.h" -#include "AliMUONGlobalTrigger.h" +#include "AliMUONTransientDigit.h" #include "AliMUONTriggerCircuit.h" -#include "AliHitMap.h" -#include "AliMUONHitMapA1.h" -#include "AliMUONChamberTrigger.h" -#include "AliMUONConstants.h" -#include "AliMUONClusterFinderVS.h" #include "AliMUONTriggerDecision.h" -#include "AliRun.h" -#include "AliHeader.h" -#include "AliMC.h" -#include "AliMUONClusterInput.h" -#include "AliMUONMerger.h" -#include "iostream.h" -#include "AliCallf77.h" -#include "AliConst.h" +#include "AliMUONVGeometryBuilder.h" +#include "AliRun.h" +#include "AliMUONDigitizerv1.h" + // Defaults parameters for Z positions of chambers // taken from values for "stations" in AliMUON::AliMUON @@ -264,7 +92,7 @@ Log message added // for the first and second chambers in the station, respectively ClassImp(AliMUON) -//___________________________________________ +//__________________________________________________________________ AliMUON::AliMUON() { // Default Constructor @@ -272,268 +100,115 @@ AliMUON::AliMUON() fNCh = 0; fNTrackingCh = 0; fIshunt = 0; - fHits = 0; - fPadHits = 0; - fNPadHits = 0; fChambers = 0; - fDchambers = 0; - fTriggerCircuits = 0; - fNdch = 0; - fRawClusters = 0; - fNrawch = 0; - fGlobalTrigger = 0; - fNLocalTrigger = 0; - fLocalTrigger = 0; - fNLocalTrigger = 0; + fGeometryBuilders = 0; + fTriggerCircuits = 0; fAccMin = 0.; fAccMax = 0.; fAccCut = kFALSE; fMerger = 0; + fFileName = 0; + fMUONData = 0; + fSplitLevel = 0; } - -//___________________________________________ +//__________________________________________________________________ AliMUON::AliMUON(const char *name, const char *title) - : AliDetector(name,title) + : AliDetector(name,title) { //Begin_Html /* */ //End_Html + fMUONData = 0x0; + fSplitLevel= 0; + fIshunt = 0; - fHits = new TClonesArray("AliMUONHit",1000); - gAlice->AddHitList(fHits); - fPadHits = new TClonesArray("AliMUONPadHit",10000); - fNPadHits = 0; - fIshunt = 0; - - fNCh = AliMUONConstants::NCh(); - fNTrackingCh = AliMUONConstants::NTrackingCh(); - fNdch = new Int_t[fNCh]; + fNCh = AliMUONConstants::NCh(); + fNTrackingCh = AliMUONConstants::NTrackingCh(); - fDchambers = new TObjArray(AliMUONConstants::NCh()); - - Int_t i; - - for (i=0; iSetGid(0); - // Default values for Z of chambers - chamber->SetZ(AliMUONConstants::DefaultChamberZ(ch)); -// - chamber->InitGeo(AliMUONConstants::DefaultChamberZ(ch)); -// Set chamber inner and outer radius to default - chamber->SetRInner(AliMUONConstants::Dmin(st)/2); - chamber->SetROuter(AliMUONConstants::Dmax(st)/2); -// - } // Chamber stCH (0, 1) in + for (Int_t stCH = 0; stCH < 2; stCH++) { + // + // + // Default Parameters for Muon Tracking Stations + ch = 2 * st + stCH; + if (ch < AliMUONConstants::NTrackingCh()) { + fChambers->AddAt(new AliMUONChamber(ch),ch); + } else { + fChambers->AddAt(new AliMUONChamberTrigger(ch),ch); + } + AliMUONChamber* chamber = (AliMUONChamber*) fChambers->At(ch); + //chamber->SetGid(0); + // Default values for Z of chambers + chamber->SetZ(AliMUONConstants::DefaultChamberZ(ch)); + // + chamber->InitGeo(AliMUONConstants::DefaultChamberZ(ch)); + // Set chamber inner and outer radius to default + chamber->SetRInner(AliMUONConstants::Dmin(st)/2); + chamber->SetROuter(AliMUONConstants::Dmax(st)/2); + // + } // Chamber stCH (0, 1) in } // Station st (0...) - fMaxStepGas=0.01; - fMaxStepAlu=0.1; + + // Negatives values are ignored by geant3 CONS200 in the calculation of the tracking parameters + fMaxStepGas=0.1; + fMaxStepAlu=0.1; fMaxDestepGas=-1; fMaxDestepAlu=-1; -// - fMaxIterPad = 0; - fCurIterPad = 0; -// - fAccMin = 0.; - fAccMax = 0.; - fAccCut = kFALSE; - - // cp new design of AliMUONTriggerDecision - fTriggerCircuits = new TObjArray(AliMUONConstants::NTriggerCircuit()); - for (Int_t circ=0; circAddAt(new AliMUONTriggerCircuit(),circ); + } + fMerger = 0; } - -//___________________________________________ -AliMUON::AliMUON(const AliMUON& rMUON) +//____________________________________________________________________ +AliMUON::AliMUON(const AliMUON& rMUON):AliDetector(rMUON) { // Dummy copy constructor ; } - +//____________________________________________________________________ AliMUON::~AliMUON() { // Destructor - if(fDebug) printf("%s: Calling AliMUON destructor !!!\n",ClassName()); - - Int_t i; - fIshunt = 0; - - // Delete TObjArrays - - if (fChambers){ - fChambers->Delete(); - delete fChambers; - } - - if (fTriggerCircuits){ - fTriggerCircuits->Delete(); - delete fTriggerCircuits; - } - - if (fDchambers){ - fDchambers->Delete(); - delete fDchambers; - } - - if (fRawClusters){ - fRawClusters->Delete(); - delete fRawClusters; - } - for (i=0;iDelete(); - delete fPadHits; - } - - if (fGlobalTrigger){ - fGlobalTrigger->Delete(); - delete fGlobalTrigger; - } - fNGlobalTrigger = 0; - - if (fLocalTrigger){ - fLocalTrigger->Delete(); - delete fLocalTrigger; - } - fNLocalTrigger = 0; - - if (fHits2){ - fHits2->Delete(); - delete fHits2; - } - - if (fPadHits2){ - fPadHits2->Delete(); - delete fPadHits2; - } + if(fDebug) printf("%s: Calling AliMUON destructor !!!\n",ClassName()); + fIshunt = 0; + if (fMerger) delete fMerger; - if (fHits) { - fHits->Delete(); - delete fHits; - } - - // Delete hits tree for background event - - if (fTrH1) { - fTrH1->Delete(); - delete fTrH1; - } - - if (fMerger) delete fMerger; -} - -//___________________________________________ -void AliMUON::AddHit(Int_t track, Int_t *vol, Float_t *hits) -{ - TClonesArray &lhits = *fHits; - new(lhits[fNhits++]) AliMUONHit(fIshunt,track,vol,hits); -} -//___________________________________________ -void AliMUON::AddPadHit(Int_t *clhits) -{ - TClonesArray &lclusters = *fPadHits; - new(lclusters[fNPadHits++]) AliMUONPadHit(clhits); + if (fGeometryBuilders){ + fGeometryBuilders->Delete(); + delete fGeometryBuilders; + } } //_____________________________________________________________________________ -void AliMUON::AddDigits(Int_t id, Int_t *tracks, Int_t *charges, Int_t *digits) +void AliMUON::AddGeometryBuilder(AliMUONVGeometryBuilder* geomBuilder) { - // - // Add a MUON digit to the list - // - - TClonesArray &ldigits = *((TClonesArray*)(*fDchambers)[id]); - new(ldigits[fNdch[id]++]) AliMUONDigit(tracks,charges,digits); -} +// Adds the geometry builder to the list +// --- -//_____________________________________________________________________________ -void AliMUON::AddRawCluster(Int_t id, const AliMUONRawCluster& c) -{ - // - // Add a MUON digit to the list - // - - TClonesArray &lrawcl = *((TClonesArray*)(*fRawClusters)[id]); - new(lrawcl[fNrawch[id]++]) AliMUONRawCluster(c); -} - -//___________________________________________ -void AliMUON::AddGlobalTrigger(Int_t *singlePlus, Int_t *singleMinus, - Int_t *singleUndef, - Int_t *pairUnlike, Int_t *pairLike) -{ -// add a MUON Global Trigger to the list (only one GlobalTrigger per event !) - TClonesArray &globalTrigger = *fGlobalTrigger; - new(globalTrigger[fNGlobalTrigger++]) - AliMUONGlobalTrigger(singlePlus, singleMinus, singleUndef, pairUnlike, - pairLike); + fGeometryBuilders->Add(geomBuilder); } -//___________________________________________ -void AliMUON::AddLocalTrigger(Int_t *localtr) -{ -// add a MUON Local Trigger to the list - TClonesArray &localTrigger = *fLocalTrigger; - new(localTrigger[fNLocalTrigger++]) AliMUONLocalTrigger(localtr); -} - -//___________________________________________ +//____________________________________________________________________ void AliMUON::BuildGeometry() { // Geometry for event display @@ -544,186 +219,26 @@ void AliMUON::BuildGeometry() } } } - -//___________________________________________ +//___________________________________________________________________ Int_t AliMUON::DistancetoPrimitive(Int_t , Int_t ) { - return 9999; -} - -//___________________________________________ -void AliMUON::MakeBranch(Option_t* option, const char *file) -{ - // - // Create Tree branches for the MUON. - // - const Int_t kBufferSize = 4000; - char branchname[30]; - sprintf(branchname,"%sCluster",GetName()); - - AliDetector::MakeBranch(option,file); - - const char *cD = strstr(option,"D"); - const char *cR = strstr(option,"R"); - const char *cH = strstr(option,"H"); - - if (fPadHits && gAlice->TreeH() && cH) { - MakeBranchInTree(gAlice->TreeH(), - branchname, &fPadHits, kBufferSize, file); - } - - if (cD) { - // - // one branch for digits per chamber - // - Int_t i; - - for (i=0; iTreeD()) { - MakeBranchInTree(gAlice->TreeD(), - branchname, &((*fDchambers)[i]), kBufferSize, file); - printf("Making Branch %s for digits in chamber %d\n",branchname,i+1); - } - } - } - - if (cR) { - // - // one branch for raw clusters per chamber - // - printf("Make Branch - TreeR address %p\n",gAlice->TreeR()); - - Int_t i; - - for (i=0; iTreeR()) { - MakeBranchInTree(gAlice->TreeR(), - branchname, &((*fRawClusters)[i]), kBufferSize, file); - printf("Making Branch %s for raw clusters in chamber %d\n",branchname,i+1); - } - } - // - // one branch for global trigger - // - sprintf(branchname,"%sGlobalTrigger",GetName()); - if (fGlobalTrigger && gAlice->TreeR()) { - MakeBranchInTree(gAlice->TreeR(), - branchname, &fGlobalTrigger, kBufferSize, file); - printf("Making Branch %s for Global Trigger\n",branchname); - } - // - // one branch for local trigger - // - sprintf(branchname,"%sLocalTrigger",GetName()); - if (fLocalTrigger && gAlice->TreeR()) { - MakeBranchInTree(gAlice->TreeR(), - branchname, &fLocalTrigger, kBufferSize, file); - printf("Making Branch %s for Local Trigger\n",branchname); - } - } -} - -//___________________________________________ -void AliMUON::SetTreeAddress() -{ - // Set branch address for the Hits and Digits Tree. - char branchname[30]; - AliDetector::SetTreeAddress(); - - TBranch *branch; - TTree *treeH = gAlice->TreeH(); - TTree *treeD = gAlice->TreeD(); - TTree *treeR = gAlice->TreeR(); - - if (treeH) { - if (fPadHits) { - branch = treeH->GetBranch("MUONCluster"); - if (branch) branch->SetAddress(&fPadHits); - } - } - - if (treeD) { - for (int i=0; iGetBranch(branchname); - if (branch) branch->SetAddress(&((*fDchambers)[i])); - } - } - } - - // printf("SetTreeAddress --- treeR address %p \n",treeR); - - if (treeR) { - for (int i=0; iGetBranch(branchname); - if (branch) branch->SetAddress(&((*fRawClusters)[i])); - } - } - - if (fLocalTrigger) { - branch = treeR->GetBranch("MUONLocalTrigger"); - if (branch) branch->SetAddress(&fLocalTrigger); - } - if (fGlobalTrigger) { - branch = treeR->GetBranch("MUONGlobalTrigger"); - if (branch) branch->SetAddress(&fGlobalTrigger); - } - } -} -//___________________________________________ -void AliMUON::ResetHits() -{ - // Reset number of clusters and the cluster array for this detector - AliDetector::ResetHits(); - fNPadHits = 0; - if (fPadHits) fPadHits->Clear(); + return 9999; } - -//____________________________________________ -void AliMUON::ResetDigits() -{ - // - // Reset number of digits and the digits array for this detector - // - for ( int i=0;iClear(); - if (fNdch) fNdch[i]=0; - } -} -//____________________________________________ -void AliMUON::ResetRawClusters() -{ - // - // Reset number of raw clusters and the raw clust array for this detector - // - for ( int i=0;iClear(); - if (fNrawch) fNrawch[i]=0; - } -} - -//____________________________________________ -void AliMUON::ResetTrigger() +//__________________________________________________________________ +void AliMUON::SetTreeAddress() { - // Reset Local and Global Trigger - fNGlobalTrigger = 0; - if (fGlobalTrigger) fGlobalTrigger->Clear(); - fNLocalTrigger = 0; - if (fLocalTrigger) fLocalTrigger->Clear(); + GetMUONData()->SetLoader(fLoader); + GetMUONData()->SetTreeAddress("H,D,RC"); + fHits = GetMUONData()->Hits(); // Added by Ivana to use the methods FisrtHit, NextHit of AliDetector } -//____________________________________________ +//____________________________________________________________________ void AliMUON::SetPadSize(Int_t id, Int_t isec, Float_t p1, Float_t p2) { // Set the pad size for chamber id and cathode isec Int_t i=2*(id-1); - ((AliMUONChamber*) (*fChambers)[i]) ->SetPadSize(isec,p1,p2); - ((AliMUONChamber*) (*fChambers)[i+1])->SetPadSize(isec,p1,p2); + ((AliMUONChamber*) fChambers->At(i)) ->SetPadSize(isec,p1,p2); + ((AliMUONChamber*) fChambers->At(i+1))->SetPadSize(isec,p1,p2); } //___________________________________________ @@ -732,11 +247,10 @@ void AliMUON::SetChambersZ(const Float_t *Z) // Set Z values for all chambers (tracking and trigger) // from the array pointed to by "Z" for (Int_t ch = 0; ch < AliMUONConstants::NCh(); ch++) - ((AliMUONChamber*) ((*fChambers)[ch]))->SetZ(Z[ch]); + ((AliMUONChamber*) fChambers->At(ch))->SetZ(Z[ch]); return; } - -//___________________________________________ +//_________________________________________________________________ void AliMUON::SetChambersZToDefault() { // Set Z values for all chambers (tracking and trigger) @@ -744,117 +258,148 @@ void AliMUON::SetChambersZToDefault() SetChambersZ(AliMUONConstants::DefaultChamberZ()); return; } - -//___________________________________________ +//_________________________________________________________________ void AliMUON::SetChargeSlope(Int_t id, Float_t p1) { // Set the inverse charge slope for chamber id - Int_t i=2*(id-1); - ((AliMUONChamber*) (*fChambers)[i])->SetChargeSlope(p1); - ((AliMUONChamber*) (*fChambers)[i+1])->SetChargeSlope(p1); + Int_t i=2*(id-1); //PH ((AliMUONChamber*) (*fChambers)[i])->SetSigmaIntegration(p1); + //PH ((AliMUONChamber*) (*fChambers)[i+1])->SetSigmaIntegration(p1); + ((AliMUONChamber*) fChambers->At(i))->SetChargeSlope(p1); + ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSlope(p1); } - -//___________________________________________ +//__________________________________________________________________ void AliMUON::SetChargeSpread(Int_t id, Float_t p1, Float_t p2) { // Set sigma of charge spread for chamber id Int_t i=2*(id-1); - ((AliMUONChamber*) (*fChambers)[i])->SetChargeSpread(p1,p2); - ((AliMUONChamber*) (*fChambers)[i+1])->SetChargeSpread(p1,p2); + ((AliMUONChamber*) fChambers->At(i))->SetChargeSpread(p1,p2); + ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSpread(p1,p2); } - -//___________________________________________ +//___________________________________________________________________ void AliMUON::SetSigmaIntegration(Int_t id, Float_t p1) { // Set integration limits for charge spread Int_t i=2*(id-1); - ((AliMUONChamber*) (*fChambers)[i])->SetSigmaIntegration(p1); - ((AliMUONChamber*) (*fChambers)[i+1])->SetSigmaIntegration(p1); + ((AliMUONChamber*) fChambers->At(i))->SetSigmaIntegration(p1); + ((AliMUONChamber*) fChambers->At(i+1))->SetSigmaIntegration(p1); } -//___________________________________________ +//__________________________________________________________________ void AliMUON::SetMaxAdc(Int_t id, Int_t p1) { // Set maximum number for ADCcounts (saturation) Int_t i=2*(id-1); - ((AliMUONChamber*) (*fChambers)[i])->SetMaxAdc(p1); - ((AliMUONChamber*) (*fChambers)[i+1])->SetMaxAdc(p1); + ((AliMUONChamber*) fChambers->At(i))->SetMaxAdc(p1); + ((AliMUONChamber*) fChambers->At(i+1))->SetMaxAdc(p1); } - -//___________________________________________ +//__________________________________________________________________ void AliMUON::SetMaxStepGas(Float_t p1) { // Set stepsize in gas - fMaxStepGas=p1; + fMaxStepGas=p1; } - -//___________________________________________ +//__________________________________________________________________ void AliMUON::SetMaxStepAlu(Float_t p1) { // Set step size in Alu fMaxStepAlu=p1; } - -//___________________________________________ +//__________________________________________________________________ void AliMUON::SetMaxDestepGas(Float_t p1) { // Set maximum step size in Gas fMaxDestepGas=p1; } - -//___________________________________________ +//__________________________________________________________________ void AliMUON::SetMaxDestepAlu(Float_t p1) { // Set maximum step size in Alu - fMaxDestepAlu=p1; + fMaxDestepAlu=p1; } -//___________________________________________ +//___________________________________________________________________ void AliMUON::SetAcceptance(Bool_t acc, Float_t angmin, Float_t angmax) { // Set acceptance cuts - fAccCut=acc; - fAccMin=angmin*TMath::Pi()/180; - fAccMax=angmax*TMath::Pi()/180; - Int_t ch; - if (acc) { - for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) { - // Loop over 2 chambers in the station - for (Int_t stCH = 0; stCH < 2; stCH++) { - ch = 2 * st + stCH; -// Set chamber inner and outer radius according to acceptance cuts - Chamber(ch).SetRInner(AliMUONConstants::DefaultChamberZ(ch)*TMath::Tan(fAccMin)); - Chamber(ch).SetROuter(AliMUONConstants::DefaultChamberZ(ch)*TMath::Tan(fAccMax)); - } // chamber loop - } // station loop - } + fAccCut=acc; + fAccMin=angmin*TMath::Pi()/180; + fAccMax=angmax*TMath::Pi()/180; + Int_t ch; + if (acc) { + for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) { + // Loop over 2 chambers in the station + for (Int_t stCH = 0; stCH < 2; stCH++) { + ch = 2 * st + stCH; + // Set chamber inner and outer radius according to acceptance cuts + Chamber(ch).SetRInner(TMath::Abs(AliMUONConstants::DefaultChamberZ(ch)*TMath::Tan(fAccMin))); + Chamber(ch).SetROuter(TMath::Abs(AliMUONConstants::DefaultChamberZ(ch)*TMath::Tan(fAccMax))); + } // chamber loop + } // station loop + } } -//___________________________________________ + +//____________________________________________________________________ +Float_t AliMUON::GetMaxStepGas() const +{ +// Return stepsize in gas + + return fMaxStepGas; +} + +//____________________________________________________________________ +Float_t AliMUON::GetMaxStepAlu() const +{ +// Return step size in Alu + + return fMaxStepAlu; +} + +//____________________________________________________________________ +Float_t AliMUON::GetMaxDestepGas() const +{ +// Return maximum step size in Gas + + return fMaxDestepGas; +} + +//____________________________________________________________________ +Float_t AliMUON::GetMaxDestepAlu() const +{ +// Return maximum step size in Gas + + return fMaxDestepAlu; +} + +//____________________________________________________________________ void AliMUON::SetSegmentationModel(Int_t id, Int_t isec, AliSegmentation *segmentation) { // Set the segmentation for chamber id cathode isec - ((AliMUONChamber*) (*fChambers)[id])->SetSegmentationModel(isec, segmentation); + ((AliMUONChamber*) fChambers->At(id))->SetSegmentationModel(isec, segmentation); } -//___________________________________________ +//____________________________________________________________________ void AliMUON::SetResponseModel(Int_t id, AliMUONResponse *response) { // Set the response for chamber id - ((AliMUONChamber*) (*fChambers)[id])->SetResponseModel(response); + ((AliMUONChamber*) fChambers->At(id))->SetResponseModel(response); } - +//____________________________________________________________________ void AliMUON::SetReconstructionModel(Int_t id, AliMUONClusterFinderVS *reconst) { // Set ClusterFinder for chamber id - ((AliMUONChamber*) (*fChambers)[id])->SetReconstructionModel(reconst); + ((AliMUONChamber*) fChambers->At(id))->SetReconstructionModel(reconst); } - +//____________________________________________________________________ void AliMUON::SetNsec(Int_t id, Int_t nsec) { // Set number of segmented cathods for chamber id - ((AliMUONChamber*) (*fChambers)[id])->SetNsec(nsec); + ((AliMUONChamber*) fChambers->At(id))->SetNsec(nsec); } - -//___________________________________________ +//____________________________________________________________________ +AliDigitizer* AliMUON::CreateDigitizer(AliRunDigitizer* manager) const +{ + return new AliMUONDigitizerv1(manager); +} +//_____________________________________________________________________ void AliMUON::SDigits2Digits() { @@ -870,62 +415,29 @@ void AliMUON::SDigits2Digits() fMerger->Init(); fMerger->Digitise(); char hname[30]; - sprintf(hname,"TreeD%d",gAlice->GetHeader()->GetEvent()); - gAlice->TreeD()->Write(hname,TObject::kOverwrite); - gAlice->TreeD()->Reset(); + // sprintf(hname,"TreeD%d",fLoader->GetHeader()->GetEvent()); + fLoader->TreeD()->Write(hname,TObject::kOverwrite); + fLoader->TreeD()->Reset(); } -//___________________________________________ -void AliMUON::MakePadHits(Float_t xhit,Float_t yhit, Float_t zhit, - Float_t eloss, Float_t tof, Int_t idvol) -{ -// -// Calls the charge disintegration method of the current chamber and adds -// the simulated cluster to the root treee -// - Int_t clhits[7]; - Float_t newclust[6][500]; - Int_t nnew; - - -// -// Integrated pulse height on chamber +//_______________________________________________________________________ +AliLoader* AliMUON::MakeLoader(const char* topfoldername) +{ +//builds standard getter (AliLoader type) +//if detector wants to use castomized getter, it must overload this method - - clhits[0]=fNhits+1; -// -// -// if (idvol == 6) printf("\n ->Disintegration %f %f %f", xhit, yhit, eloss ); - - - ((AliMUONChamber*) (*fChambers)[idvol]) - ->DisIntegration(eloss, tof, xhit, yhit, zhit, nnew, newclust); - Int_t ic=0; -// if (idvol == 6) printf("\n nnew %d \n", nnew); -// -// Add new clusters - for (Int_t i=0; i 0) { - ic++; -// Cathode plane - clhits[1] = Int_t(newclust[5][i]); -// Cluster Charge - clhits[2] = Int_t(newclust[0][i]); -// Pad: ix - clhits[3] = Int_t(newclust[1][i]); -// Pad: iy - clhits[4] = Int_t(newclust[2][i]); -// Pad: charge - clhits[5] = Int_t(newclust[3][i]); -// Pad: chamber sector - clhits[6] = Int_t(newclust[4][i]); - - AddPadHit(clhits); - } - } + if (GetDebug()) + Info("MakeLoader", + "Creating standard getter for detector %s. Top folder is %s.", + GetName(),topfoldername); + + fLoader = new AliLoader(GetName(),topfoldername); + fMUONData = new AliMUONData(fLoader,GetName(),GetName()); + fMUONData->SetSplitLevel(fSplitLevel); + return fLoader; } -//___________________________________________ +//_______________________________________________________________________ void AliMUON::Trigger(Int_t nev){ // call the Trigger Algorithm and fill TreeR @@ -934,59 +446,59 @@ void AliMUON::Trigger(Int_t nev){ Int_t singleUndef[3] = {0,0,0}; Int_t pairUnlike[3] = {0,0,0}; Int_t pairLike[3] = {0,0,0}; - + ResetTrigger(); AliMUONTriggerDecision* decision= new AliMUONTriggerDecision(1); decision->Trigger(); decision->GetGlobalTrigger(singlePlus, singleMinus, singleUndef, pairUnlike, pairLike); -// add a local trigger in the list - AddGlobalTrigger(singlePlus, singleMinus, singleUndef, pairUnlike, pairLike); + + // add a local trigger in the list + GetMUONData()->AddGlobalTrigger(singlePlus, singleMinus, singleUndef, pairUnlike, pairLike); Int_t i; for (Int_t icirc=0; icircGetITrigger(icirc)==1) { - Int_t localtr[7]={0,0,0,0,0,0,0}; - Int_t loLpt[2]={0,0}; Int_t loHpt[2]={0,0}; Int_t loApt[2]={0,0}; - decision->GetLutOutput(icirc, loLpt, loHpt, loApt); - localtr[0] = icirc; - localtr[1] = decision->GetStripX11(icirc); - localtr[2] = decision->GetDev(icirc); - localtr[3] = decision->GetStripY11(icirc); - for (i=0; i<2; i++) { // convert the Lut output in 1 digit - localtr[4] = localtr[4]+Int_t(loLpt[i]*TMath::Power(2,i)); - localtr[5] = localtr[5]+Int_t(loHpt[i]*TMath::Power(2,i)); - localtr[6] = localtr[6]+Int_t(loApt[i]*TMath::Power(2,i)); - } - AddLocalTrigger(localtr); // add a local trigger in the list + if(decision->GetITrigger(icirc)==1) { + Int_t localtr[7]={0,0,0,0,0,0,0}; + Int_t loLpt[2]={0,0}; Int_t loHpt[2]={0,0}; Int_t loApt[2]={0,0}; + decision->GetLutOutput(icirc, loLpt, loHpt, loApt); + localtr[0] = icirc; + localtr[1] = decision->GetStripX11(icirc); + localtr[2] = decision->GetDev(icirc); + localtr[3] = decision->GetStripY11(icirc); + for (i=0; i<2; i++) { // convert the Lut output in 1 digit + localtr[4] = localtr[4]+Int_t(loLpt[i]*TMath::Power(2,i)); + localtr[5] = localtr[5]+Int_t(loHpt[i]*TMath::Power(2,i)); + localtr[6] = localtr[6]+Int_t(loApt[i]*TMath::Power(2,i)); } + GetMUONData()->AddLocalTrigger(localtr); // add a local trigger in the list + } } + delete decision; - gAlice->TreeR()->Fill(); - ResetTrigger(); - char hname[30]; - sprintf(hname,"TreeR%d",nev); - gAlice->TreeR()->Write(hname,TObject::kOverwrite); - gAlice->TreeR()->Reset(); + // fLoader->TreeR()->Fill(); + GetMUONData()->Fill("GLT"); //Filling Global and Local Trigger GLT + // char hname[30]; + // sprintf(hname,"TreeR%d",nev); + // fLoader->TreeR()->Write(hname,TObject::kOverwrite); + // fLoader->TreeR()->Reset(); + fLoader->WriteRecPoints("OVERWRITE"); + printf("\n End of trigger for event %d", nev); } - -//____________________________________________ +//____________________________________________________________________ void AliMUON::Digits2Reco() { FindClusters(); Int_t nev = gAlice->GetHeader()->GetEvent(); - gAlice->TreeR()->Fill(); - char hname[30]; - sprintf(hname,"TreeR%d", nev); - gAlice->TreeR()->Write(hname); - gAlice->TreeR()->Reset(); - ResetRawClusters(); - printf("\n End of cluster finding for event %d", nev); + GetMUONData()->Fill("RC"); //Filling Reconstructed Cluster + fLoader->WriteRecPoints("OVERWRITE"); + GetMUONData()->ResetRawClusters(); + Info("Digits2Reco","End of cluster finding for event %d", nev); } - +//____________________________________________________________________ void AliMUON::FindClusters() { // @@ -997,19 +509,22 @@ void AliMUON::FindClusters() dig1 = new TClonesArray("AliMUONDigit",1000); dig2 = new TClonesArray("AliMUONDigit",1000); AliMUONDigit *digit; -// // Loop on chambers and on cathode planes // ResetRawClusters(); + TClonesArray * muonDigits; + for (Int_t ich = 0; ich < 10; ich++) { - AliMUONChamber* iChamber = (AliMUONChamber*) (*fChambers)[ich]; + //PH AliMUONChamber* iChamber = (AliMUONChamber*) (*fChambers)[ich]; + AliMUONChamber* iChamber = (AliMUONChamber*) fChambers->At(ich); AliMUONClusterFinderVS* rec = iChamber->ReconstructionModel(); - gAlice->ResetDigits(); - gAlice->TreeD()->GetEvent(0); - TClonesArray *muonDigits = this->DigitsAddress(ich); + ResetDigits(); + GetMUONData()->GetCathode(0); + //TClonesArray * + muonDigits = GetMUONData()->Digits(ich); ndig=muonDigits->GetEntriesFast(); - printf("\n 1 Found %d digits in %p %d", ndig, muonDigits,ich); + printf("\n 1 Found %d digits in %p chamber %d", ndig, muonDigits,ich); TClonesArray &lhits1 = *dig1; Int_t n = 0; for (k = 0; k < ndig; k++) { @@ -1017,9 +532,9 @@ void AliMUON::FindClusters() if (rec->TestTrack(digit->Track(0))) new(lhits1[n++]) AliMUONDigit(*digit); } - gAlice->ResetDigits(); - gAlice->TreeD()->GetEvent(1); - muonDigits = this->DigitsAddress(ich); + GetMUONData()->ResetDigits(); + GetMUONData()->GetCathode(1); + muonDigits = GetMUONData()->Digits(ich); ndig=muonDigits->GetEntriesFast(); printf("\n 2 Found %d digits in %p %d", ndig, muonDigits, ich); TClonesArray &lhits2 = *dig2; @@ -1041,9 +556,9 @@ void AliMUON::FindClusters() delete dig1; delete dig2; } - +//______________________________________________________________________ #ifdef never -void AliMUON::Streamer(TBuffer &R__b) +void AliMUON::Streamer(TBuffer &R__b)_ { // Stream an object of class AliMUON. AliMUONChamber *iChamber; @@ -1154,10 +669,10 @@ void AliMUON::Streamer(TBuffer &R__b) } } #endif - +//_______________________________________________________________________ AliMUONPadHit* AliMUON::FirstPad(AliMUONHit* hit, TClonesArray *clusters) { -// +// to be removed // Initialise the pad iterator // Return the address of the first padhit for hit TClonesArray *theClusters = clusters; @@ -1170,9 +685,10 @@ AliMUONPadHit* AliMUON::FirstPad(AliMUONHit* hit, TClonesArray *clusters) return 0; } } - +//_______________________________________________________________________ AliMUONPadHit* AliMUON::NextPad(TClonesArray *clusters) { + // To be removed // Get next pad (in iterator) // AliMUON::fCurIterPad++; @@ -1182,16 +698,16 @@ AliMUONPadHit* AliMUON::NextPad(TClonesArray *clusters) return 0; } } - +//_______________________________________________________________________ AliMUONRawCluster *AliMUON::RawCluster(Int_t ichamber, Int_t icathod, Int_t icluster) { // // Return rawcluster (icluster) for chamber ichamber and cathode icathod // Obsolete ?? - TClonesArray *muonRawCluster = RawClustAddress(ichamber); + TClonesArray *muonRawCluster = GetMUONData()->RawClusters(ichamber); ResetRawClusters(); - TTree *treeR = gAlice->TreeR(); + TTree *treeR = fLoader->TreeR(); Int_t nent=(Int_t)treeR->GetEntries(); treeR->GetEvent(nent-2+icathod-1); //treeR->GetEvent(icathod); @@ -1202,43 +718,203 @@ AliMUONRawCluster *AliMUON::RawCluster(Int_t ichamber, Int_t icathod, Int_t iclu return mRaw; } - +//________________________________________________________________________ void AliMUON::SetMerger(AliMUONMerger* merger) { // Set pointer to merger fMerger = merger; } - +//________________________________________________________________________ AliMUONMerger* AliMUON::Merger() { // Return pointer to merger return fMerger; } - - - -AliMUON& AliMUON::operator = (const AliMUON& rhs) +//________________________________________________________________________ +AliMUON& AliMUON::operator = (const AliMUON& /*rhs*/) { // copy operator // dummy version return *this; } +//________________________________________________________________________ +void AliMUON::Reconstruct() const +{ +// reconstruct clusters + AliLoader* loader = GetLoader(); + AliRunLoader* runLoader = loader->GetRunLoader(); + Int_t nEvents = runLoader->GetNumberOfEvents(); + for (Int_t i = 0; i < 10; i++) { + AliMUONClusterFinderVS *RecModel = new AliMUONClusterFinderVS(); + RecModel->SetGhostChi2Cut(10); + const_cast(this)->SetReconstructionModel(i,RecModel); + } + AliMUONEventReconstructor* reco = new AliMUONEventReconstructor(); + loader->LoadRecPoints("RECREATE"); + loader->LoadTracks("RECREATE"); + loader->LoadDigits("READ"); + // Loop over events + for(Int_t ievent = 0; ievent < nEvents; ievent++) { + printf("event %d\n",ievent); + runLoader->GetEvent(ievent); + //---------------------------- digit2Reco & Trigger --------------------- + if (!loader->TreeR()) loader->MakeRecPointsContainer(); + + // tracking branch + fMUONData->MakeBranch("RC"); + fMUONData->SetTreeAddress("D,RC"); + const_cast(this)->Digits2Reco(); + // trigger branch + fMUONData->MakeBranch("GLT"); + fMUONData->SetTreeAddress("D,GLT"); + const_cast(this)->Trigger(ievent); + //---------------------------- Track & TriggerTrack --------------------- + if (!loader->TreeT()) loader->MakeTracksContainer(); + fMUONData->MakeBranch("RT"); //track + fMUONData->SetTreeAddress("RT"); + reco->EventReconstruct(); + for(Int_t i=0; iGetNRecTracks(); i++) { + AliMUONTrack * track = (AliMUONTrack*) reco->GetRecTracksPtr()->At(i); + fMUONData->AddRecTrack(*track); + } + fMUONData->Fill("RT"); + + fMUONData->MakeBranch("RL"); //trigger track + fMUONData->SetTreeAddress("RL"); + reco->EventReconstructTrigger(); + for(Int_t i=0; iGetNRecTriggerTracks(); i++) { + AliMUONTriggerTrack * triggertrack = (AliMUONTriggerTrack*) reco->GetRecTriggerTracksPtr()->At(i); + fMUONData->AddRecTriggerTrack(*triggertrack); + } + fMUONData->Fill("RL"); + loader->WriteTracks("OVERWRITE"); + + //--------------------------- Resetting branches ----------------------- + fMUONData->ResetDigits(); + fMUONData->ResetRawClusters(); + fMUONData->ResetTrigger(); + fMUONData->ResetRecTracks(); + fMUONData->ResetRecTriggerTracks(); + } + loader->UnloadDigits(); + loader->UnloadRecPoints(); + loader->UnloadTracks(); +} +//________________________________________________________________________ +void AliMUON::FillESD(AliESD* event) const +{ + TClonesArray * recTracksArray; + + AliLoader* loader = GetLoader(); + AliRunLoader* runLoader = loader->GetRunLoader(); + loader->LoadTracks("READ"); + // declaration + Int_t ievent; + Int_t ntrackhits; + Double_t fitfmin; + Int_t nrectracks; + Double_t bendingSlope, nonBendingSlope, fInverseBendingMomentum; + Double_t fXRec, fYRec, fZRec; + Float_t x11, y11, thetaX,thetaY ; + Int_t nEvents = runLoader->GetNumberOfEvents(); + // setting pointer for tracks, triggertracks& trackparam at vertex + AliMUONTrack * rectrack; + AliMUONTriggerTrack * rectriggertrack; + AliMUONTrackParam *trackParam; + + for (ievent = 0; ievent < nEvents; ievent++) { + runLoader->GetEvent(ievent); + + // setting ESD MUON class + AliESDMuonTrack* ESDTrack = new AliESDMuonTrack() ; + + // -------------------- tracks------------- + fMUONData->SetTreeAddress("RT"); + fMUONData->GetRecTracks(); + recTracksArray = fMUONData->RecTracks(); + + nrectracks = (Int_t) recTracksArray->GetEntriesFast(); // + + // printf(">>> Event %d Number of Recconstructed tracks %d \n",ievent, nrectracks); + + // read track infos + for (Int_t irectracks = 0; irectracks < nrectracks; irectracks++) { + + rectrack = (AliMUONTrack*) recTracksArray->At(irectracks); + + trackParam = rectrack->GetTrackParamAtVertex(); + + bendingSlope = trackParam->GetBendingSlope(); + nonBendingSlope = trackParam->GetNonBendingSlope(); + fInverseBendingMomentum = trackParam->GetInverseBendingMomentum(); + fXRec = trackParam->GetNonBendingCoor(); + fYRec = trackParam->GetBendingCoor(); + fZRec = trackParam->GetZ(); + + ntrackhits = rectrack->GetNTrackHits(); + fitfmin = rectrack->GetFitFMin(); + + // setting data member of ESD MUON + ESDTrack->SetInverseBendingMomentum(fInverseBendingMomentum); + ESDTrack->SetThetaX(TMath::ATan(nonBendingSlope)); + ESDTrack->SetThetaY(TMath::ATan(bendingSlope)); + ESDTrack->SetZ(fZRec); + ESDTrack->SetBendingCoor(fYRec); + ESDTrack->SetNonBendingCoor(fXRec); + ESDTrack->SetChi2(fitfmin); + ESDTrack->SetNHit(ntrackhits); + } + + // // -------------------- trigger tracks------------- + fMUONData->SetTreeAddress("RL"); + fMUONData->GetRecTriggerTracks(); + recTracksArray = fMUONData->RecTriggerTracks(); + + nrectracks = (Int_t) recTracksArray->GetEntriesFast(); // + + // printf(">>> Event %d Number of Recconstructed tracks %d \n",ievent, nrectracks); + + // read trigger track infos + for (Int_t irectracks = 0; irectracks < nrectracks; irectracks++) { + + rectriggertrack = (AliMUONTriggerTrack*) recTracksArray->At(irectracks); + + x11 = rectriggertrack->GetY11(); + y11 = rectriggertrack->GetY11(); + thetaX = rectriggertrack->GetThetax(); + thetaY = rectriggertrack->GetThetay(); + + // setting data member of ESD MUON trigger + ESDTrack->SetThetaX11(thetaX); + ESDTrack->SetThetaY11(thetaY); + ESDTrack->SetX11(x11); + ESDTrack->SetY11(y11); + } + + // storing ESD MUON Track into ESD Event & reset muondata + event->AddMuonTrack(ESDTrack); + fMUONData->ResetRecTracks(); + fMUONData->ResetRecTriggerTracks(); + + } // end loop on event + loader->UnloadTracks(); +}