Clear method added to several classes
authorauras <auras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Jul 2012 14:19:33 +0000 (14:19 +0000)
committerauras <auras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Jul 2012 14:19:33 +0000 (14:19 +0000)
MFT/AliESDEventMFT.cxx
MFT/AliESDEventMFT.h
MFT/AliMFTCluster.cxx
MFT/AliMFTCluster.h
MFT/AliMuonForwardTrack.cxx
MFT/AliMuonForwardTrack.h
MFT/AliMuonForwardTrackPair.cxx
MFT/AliMuonForwardTrackPair.h
MFT/runMFT.sh
MFT/runReconstruction.C

index ebf1a81..8138c29 100644 (file)
@@ -60,12 +60,14 @@ AliESDEventMFT::AliESDEventMFT(AliESDEvent &esdEvent):
 
 AliESDEventMFT::AliESDEventMFT(const AliESDEventMFT &esdEventMFT): 
   AliESDEvent(esdEventMFT),
-  fMuonForwardTracks(esdEventMFT.fMuonForwardTracks)
+  fMuonForwardTracks(NULL)
 {
 
   // copy constructor
+  fMuonForwardTracks      = new TClonesArray(*(esdEventMFT.fMuonForwardTracks));
+  fMuonForwardTracks->SetOwner(kTRUE);
   AddObject(fMuonForwardTracks);
-  
+
 }
 
 //====================================================================================================================================================
@@ -81,9 +83,11 @@ AliESDEventMFT& AliESDEventMFT::operator=(const AliESDEventMFT &esdEventMFT) {
   AliESDEvent::operator=(esdEventMFT);
   
   // clear memory
-  Clear();
+  Clear("");
   
-  fMuonForwardTracks = esdEventMFT.fMuonForwardTracks;
+  fMuonForwardTracks      = new TClonesArray(*(esdEventMFT.fMuonForwardTracks));
+  fMuonForwardTracks->SetOwner(kTRUE);
+  AddObject(fMuonForwardTracks);
 
   return *this;
 
@@ -95,10 +99,7 @@ AliESDEventMFT::~AliESDEventMFT() {
 
   // destructor
 
-  if (fMuonForwardTracks) {
-    //    fMuonForwardTracks->Delete();
-    delete fMuonForwardTracks;
-  }
+  delete fMuonForwardTracks;
 
 }
 
index b55dd22..8f0c377 100644 (file)
@@ -31,6 +31,7 @@ public:
   AliESDEventMFT &operator=(const AliESDEventMFT&);
 
   virtual ~AliESDEventMFT();
+  virtual void  Clear(const Option_t* /*opt*/) { delete fMuonForwardTracks; fMuonForwardTracks = 0x0; }
 
   AliMuonForwardTrack *GetMuonForwardTrack(Int_t i) const { 
     return (AliMuonForwardTrack*)(fMuonForwardTracks?fMuonForwardTracks->UncheckedAt(i):0x0); 
index 1870894..2cfc7c8 100644 (file)
@@ -56,7 +56,7 @@ AliMFTCluster::AliMFTCluster():
   for (Int_t iTrack=0; iTrack<fNMaxMCTracks; iTrack++) fMCLabel[iTrack] = -1;
 
   fDigitsInCluster = new TClonesArray("AliMFTDigit", fNMaxDigitsPerCluster);
-
+  fDigitsInCluster -> SetOwner(kTRUE);
 }
 
 //====================================================================================================================================================
@@ -76,13 +76,15 @@ AliMFTCluster::AliMFTCluster(const AliMFTCluster& cluster):
   fSize(cluster.fSize),
   fTrackChi2(cluster.fTrackChi2),
   fLocalChi2(cluster.fLocalChi2),
-  fDigitsInCluster(cluster.fDigitsInCluster),
+  fDigitsInCluster(NULL),
   fIsClusterEditable(cluster.fIsClusterEditable)
 {
 
   // copy constructor
   for (Int_t iTrack=0; iTrack<fNMaxMCTracks; iTrack++) fMCLabel[iTrack] = (cluster.fMCLabel)[iTrack];
-  
+  fDigitsInCluster = new TClonesArray(*(cluster.fDigitsInCluster));
+  fDigitsInCluster -> SetOwner(kTRUE);
 }
 
 //====================================================================================================================================================
@@ -98,7 +100,7 @@ AliMFTCluster& AliMFTCluster::operator=(const AliMFTCluster& cluster) {
   TObject::operator=(cluster);
   
   // clear memory
-  Clear();
+  Clear("");
   
   fX                 = cluster.fX; 
   fY                 = cluster.fY; 
@@ -113,11 +115,12 @@ AliMFTCluster& AliMFTCluster::operator=(const AliMFTCluster& cluster) {
   fSize              = cluster.fSize;
   fTrackChi2         = cluster.fTrackChi2;
   fLocalChi2         = cluster.fLocalChi2;
-  fDigitsInCluster   = cluster.fDigitsInCluster;
   fIsClusterEditable = cluster.fIsClusterEditable;
 
   for (Int_t iTrack=0; iTrack<fNMaxMCTracks; iTrack++) fMCLabel[iTrack] = (cluster.fMCLabel)[iTrack];
-  
+  fDigitsInCluster      = new TClonesArray(*(cluster.fDigitsInCluster));
+  fDigitsInCluster->SetOwner(kTRUE);
+
   return *this;
 
 }
index 9462e08..f3fc2c1 100644 (file)
@@ -28,9 +28,10 @@ public:
   AliMFTCluster();
   AliMFTCluster(const AliMFTCluster&);
   AliMFTCluster& operator=(const AliMFTCluster&);
+  virtual ~AliMFTCluster() { fDigitsInCluster->Delete(); delete fDigitsInCluster; }
 
-  virtual ~AliMFTCluster() { ; }  // destructor
-
+  virtual void Clear(const Option_t* /*opt*/) { delete fDigitsInCluster; fDigitsInCluster = 0x0; }
+  
   void SetXYZ(Double_t x, Double_t y, Double_t z) { fX=x; fY=y; fZ=z; }
 
   void SetX(Double_t x) { if(fIsClusterEditable) fX = x; }
index 0880d0c..03927c9 100644 (file)
@@ -54,6 +54,7 @@ AliMuonForwardTrack::AliMuonForwardTrack():
     fParentPDGCode[iParent] =  0;
   }
   fMFTClusters = new TClonesArray("AliMFTCluster");
+  fMFTClusters -> SetOwner(kTRUE);
 
 }
 
@@ -75,7 +76,7 @@ AliMuonForwardTrack::AliMuonForwardTrack(AliMUONTrack *MUONTrack):
     fParentPDGCode[iParent] =  0;
   }
   fMFTClusters = new TClonesArray("AliMFTCluster");
-  fMFTClusters->SetOwner(kTRUE);
+  fMFTClusters -> SetOwner(kTRUE);
 
 }
 
@@ -94,6 +95,7 @@ AliMuonForwardTrack::AliMuonForwardTrack(const AliMuonForwardTrack& track):
   fMUONTrack        = new AliMUONTrack(*(track.fMUONTrack));
   if (track.fMCTrackRef) fMCTrackRef = new TParticle(*(track.fMCTrackRef));
   fMFTClusters      = new TClonesArray(*(track.fMFTClusters));
+  fMFTClusters->SetOwner(kTRUE);
   for (Int_t iPlane=0; iPlane<AliMFTConstants::fNMaxPlanes; iPlane++) fPlaneExists[iPlane] = (track.fPlaneExists)[iPlane];
   for (Int_t iParent=0; iParent<fgkNParentsMax; iParent++) {
     fParentMCLabel[iParent] = (track.fParentMCLabel)[iParent];
@@ -115,11 +117,12 @@ AliMuonForwardTrack& AliMuonForwardTrack::operator=(const AliMuonForwardTrack& t
   AliMUONTrack::operator=(track);
   
   // clear memory
-  Clear();
+  Clear("");
   
   fMUONTrack        = new AliMUONTrack(*(track.fMUONTrack));
   if (track.fMCTrackRef) fMCTrackRef = new TParticle(*(track.fMCTrackRef));
   fMFTClusters      = new TClonesArray(*(track.fMFTClusters));
+  fMFTClusters->SetOwner(kTRUE);
   fNWrongClustersMC = track.fNWrongClustersMC;
   fTrackMCId        = track.fTrackMCId;
 
@@ -135,6 +138,17 @@ AliMuonForwardTrack& AliMuonForwardTrack::operator=(const AliMuonForwardTrack& t
 
 //====================================================================================================================================================
 
+void AliMuonForwardTrack::Clear(const Option_t* /*opt*/) {
+
+  // Clear arrays
+  delete fMUONTrack;   fMUONTrack   = 0x0;
+  delete fMCTrackRef;  fMCTrackRef  = 0x0;
+  delete fMFTClusters; fMFTClusters = 0x0;
+  
+}
+
+//====================================================================================================================================================
+
 AliMuonForwardTrack::~AliMuonForwardTrack() {
 
   delete fMUONTrack;
index 8702c9d..d434406 100644 (file)
@@ -36,7 +36,8 @@ public:
   AliMuonForwardTrack(const AliMuonForwardTrack&);
   AliMuonForwardTrack &operator=(const AliMuonForwardTrack&);
   
-  virtual ~AliMuonForwardTrack();
+  virtual ~AliMuonForwardTrack(); 
+  virtual void Clear(const Option_t* /*opt*/);
 
   void SetMUONTrack(AliMUONTrack *MUONTrack);
   void SetMCTrackRef(TParticle *MCTrackRef);
index 7487e3d..f3b08f2 100644 (file)
@@ -50,7 +50,8 @@ AliMuonForwardTrackPair::AliMuonForwardTrackPair():
   // default constructor
 
   fMuonForwardTracks = new TClonesArray("AliMuonForwardTrack", 2);
-
+  fMuonForwardTracks -> SetOwner(kTRUE);
+  
 }
 
 //====================================================================================================================================================
@@ -67,7 +68,7 @@ AliMuonForwardTrackPair::AliMuonForwardTrackPair(AliMuonForwardTrack *track0, Al
 {
 
   fMuonForwardTracks = new TClonesArray("AliMuonForwardTrack", 2);
-
+  fMuonForwardTracks->SetOwner(kTRUE);
   new ((*fMuonForwardTracks)[0]) AliMuonForwardTrack(*track0);
   new ((*fMuonForwardTracks)[1]) AliMuonForwardTrack(*track1);
 
@@ -80,7 +81,7 @@ AliMuonForwardTrackPair::AliMuonForwardTrackPair(AliMuonForwardTrack *track0, Al
 
 AliMuonForwardTrackPair::AliMuonForwardTrackPair(const AliMuonForwardTrackPair& trackPair): 
   TObject(trackPair),
-  fMuonForwardTracks(trackPair.fMuonForwardTracks),
+  fMuonForwardTracks(NULL),
   fKinemMC(trackPair.fKinemMC),
   fKinem(trackPair.fKinem),
   fIsKinemSet(trackPair.fIsKinemSet),
@@ -90,7 +91,9 @@ AliMuonForwardTrackPair::AliMuonForwardTrackPair(const AliMuonForwardTrackPair&
 {
 
   // copy constructor
-  
+  fMuonForwardTracks = new TClonesArray(*(trackPair.fMuonForwardTracks));
+  fMuonForwardTracks -> SetOwner(kTRUE);
+
 }
 
 //====================================================================================================================================================
@@ -106,9 +109,11 @@ AliMuonForwardTrackPair& AliMuonForwardTrackPair::operator=(const AliMuonForward
   AliMuonForwardTrackPair::operator=(trackPair);
   
   // clear memory
-  Clear();
+  Clear("");
+  
+  fMuonForwardTracks      = new TClonesArray(*(trackPair.fMuonForwardTracks));
+  fMuonForwardTracks->SetOwner(kTRUE);
   
-  fMuonForwardTracks = trackPair.fMuonForwardTracks;
   fKinemMC = trackPair.fKinemMC;
   fKinem = trackPair.fKinem;
   fIsKinemSet = trackPair.fIsKinemSet;
index ca7466a..ab020ae 100644 (file)
@@ -32,7 +32,8 @@ public:
 
   AliMuonForwardTrackPair(const AliMuonForwardTrackPair&);
   AliMuonForwardTrackPair &operator=(const AliMuonForwardTrackPair&);
-  
+  virtual void  Clear(const Option_t* /*opt*/) { delete fMuonForwardTracks; fMuonForwardTracks = 0x0; }
+
   virtual ~AliMuonForwardTrackPair() { fMuonForwardTracks->Delete(); delete fMuonForwardTracks; }
 
   AliMuonForwardTrack* GetTrack(Int_t iTrack) { 
index 7d0c2b2..9d99951 100644 (file)
@@ -8,7 +8,7 @@ echo $CURDIR
 OUTDIR=${CURDIR}/test
 echo $OUTDIR
 mkdir $OUTDIR
-RUN=130850  # run number for OCDB access
+RUN=169099  # run number for OCDB access
 SEED=12345  # random number generator seed should be used
 SIMDIR="generated" # sub-directory where to move simulated files prior to reco
 # Copy *ALL* the macros we need in the output directory, not to mess
index 52105c3..8233ade 100644 (file)
@@ -10,31 +10,37 @@ void runReconstruction(Int_t seed, const Char_t *recOptions) {
   // GRP from local OCDB\r
   reco->SetSpecificStorage("GRP/GRP/Data",Form("local://%s",gSystem->pwd()));\r
   \r
-  // MUON Tracker -> local:///$OCDB should reflect the content of alien://folder=/alice\r
-  reco->SetDefaultStorage("alien://folder=/alice/simulation/2008/v4-15-Release/Ideal");\r
-  reco->SetSpecificStorage("MUON/Align/Data",     "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
-  reco->SetSpecificStorage("MFT/Align/Data",      "alien://folder=/alice/cern.ch/user/a/auras/OCDB/");\r
-  reco->SetSpecificStorage("MFT/Calib/RecoParam", "alien://folder=/alice/cern.ch/user/a/auras/OCDB/");\r
-\r
-  AliMUONRecoParam *param = AliMUONRecoParam::GetLowFluxParam();\r
-  param->SetPadGoodnessMask(0x8080);      \r
-  for (Int_t iCh=0; iCh<10; iCh++) {\r
-    param->SetDefaultNonBendingReso(iCh,0.2);\r
-    param->SetDefaultBendingReso(iCh,0.2);\r
-  }\r
-  param->SetSigmaCutForTracking(5.);\r
-  param->ImproveTracks(kTRUE, 4.);\r
-  param->SetStripCutForTrigger(1.5);\r
-  param->SetSigmaCutForTrigger(4.);\r
-  param->Print("FULL");\r
-  reco->SetRecoParam("MUON", param);\r
+  reco->SetDefaultStorage("alien://folder=/alice/data/2011/OCDB");\r
+\r
+  reco->SetSpecificStorage("MUON/Align/Data",                      "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/Capacitances",              "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/Config",                    "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/Gain",                      "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/GlobalTriggerBoardMasks",   "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/GlobalTriggerCrateConfig",  "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/HV",                        "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/LocalTriggerBoardMasks",    "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/MappingData",               "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/MappingRunData",            "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/Neighbours",                "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/OccupancyMap",              "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/Pedestals",                 "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/RegionalTriggerBoardMasks", "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/RegionalTriggerConfig",     "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/RejectList",                "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/TriggerDCS",                "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/TriggerEfficiency",         "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+  reco->SetSpecificStorage("MUON/Calib/TriggerLut",                "alien://folder=/alice/simulation/2008/v4-15-Release/Residual");\r
+\r
+  reco->SetSpecificStorage("MUON/Calib/RecoParam", "alien://folder=/alice/cern.ch/user/a/auras/OCDB/");\r
+  reco->SetSpecificStorage("MFT/Align/Data",       "alien://folder=/alice/cern.ch/user/a/auras/OCDB/");\r
+  reco->SetSpecificStorage("MFT/Calib/RecoParam",  "alien://folder=/alice/cern.ch/user/a/auras/OCDB/");\r
 \r
   reco->SetRunReconstruction("MUON MFT");\r
   reco->SetRunLocalReconstruction("MUON MFT");\r
   reco->SetOption("MUON MFT",recOptions);\r
   reco->SetRunQA("MUON:ALL");\r
   reco->SetQAWriteExpert(AliQAv1::kMUON);\r
-  reco->SetQARefDefaultStorage("local://$ALICE_ROOT/QAref");\r
 \r
   reco->SetWriteESDfriend(kFALSE);\r
   reco->SetStopOnError(kFALSE);\r