]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/alice-macros/muon_trackRefs.C
ATO-98 Extended print. Bug. fix. Initilaization of the flags in AddCorrectionCompact...
[u/mrichter/AliRoot.git] / EVE / alice-macros / muon_trackRefs.C
index fa372bd60b2babd1c36064338acf2b2a4aa504af..335cd9602f591d57f4af45dd23dc965da108ab71 100644 (file)
@@ -6,30 +6,23 @@
  * full copyright notice.                                                 *
  **************************************************************************/
 
-// Macro to visualise trackRef in MUON spectrometer 
-// (both tracker and trigger).
-//
-// Use muon_trackRefs(Bool_t showSimClusters) in order to run it
-//
-// Needs that alieve_init() is already called
+/// \ingroup evemacros
+/// \file muon_trackRefs.C
+/// \brief Macro to visualise trackRef in MUON spectrometer 
+/// (both tracker and trigger).
+///
+/// Use muon_trackRefs(Bool_t showSimClusters) in order to run it
+///
+/// Needs that alieve_init() is already called
+///
+/// \author P. Pillot, L. Aphecetche; Subatech
 
 #if !defined(__CINT__) || defined(__MAKECINT__)
-
-#include "AliMUONClusterStoreV2.h"
-#include "AliMUONRawClusterV2.h"
-#include "AliMUONVCluster.h"
-#include "AliMUONConstants.h"
-#include "AliMUONRecoParam.h"
-#include "AliMUONCDB.h"
-
-#include "AliRunLoader.h"
-#include "AliStack.h"
-#include "AliTrackReference.h"
-
-#include "EveBase/AliEveMagField.h"
-#include "EveBase/AliEveTrack.h"
-#include "EveBase/AliEveEventManager.h"
-
+#include <TClonesArray.h>
+#include <TTree.h>
+#include <TParticle.h>
+#include <TMath.h>
+#include <TROOT.h>
 #include <TEveManager.h>
 #include <TEveUtil.h>
 #include <TEveTrack.h>
 #include <TEveVSDStructs.h>
 #include <TEveTrackPropagator.h>
 
-#include <TClonesArray.h>
-#include <TTree.h>
-#include <TParticle.h>
-#include <TMath.h>
-#include <TROOT.h>
-
+#include <AliMUONClusterStoreV2.h>
+#include <AliMUONRawClusterV2.h>
+#include <AliMUONVCluster.h>
+#include <AliMUONConstants.h>
+#include <AliMUONRecoParam.h>
+#include <AliMUONCDB.h>
+#include <AliStack.h>
+#include <AliTrackReference.h>
+#include <AliRunLoader.h>
+#include <AliEveMagField.h>
+#include <AliEveTrack.h>
+#include <AliEveEventManager.h>
 #endif
 
-AliMUONRecoParam* gRecoParam = 0x0;
-UInt_t gRequestedStationMask = 0;
-Bool_t gRequest2ChInSameSt45 = kFALSE;
-
 //______________________________________________________________________________
 void muon_trackRef_propagator_setup(TEveTrackPropagator* trkProp, Bool_t showVertex)
 {
@@ -78,6 +73,21 @@ void muon_trackRef_propagator_setup(TEveTrackPropagator* trkProp, Bool_t showVer
 //______________________________________________________________________________
 Bool_t isReconstructible(Bool_t* chHit)
 {
+  // load recoParam from OCDB
+  static AliMUONRecoParam* gRecoParam = 0x0;
+  static UInt_t gRequestedStationMask = 0;
+  static Bool_t gRequest2ChInSameSt45 = kFALSE;
+  if (!gRecoParam)
+  {
+    gRecoParam = AliMUONCDB::LoadRecoParam();
+    if (!gRecoParam) exit(-1);
+    // compute the mask of requested stations
+    gRequestedStationMask = 0;
+    for (Int_t i = 0; i < 5; i++) if (gRecoParam->RequestStation(i)) gRequestedStationMask |= ( 1 << i );
+    // get whether a track need 2 chambers hit in the same station (4 or 5) or not to be reconstructible
+    gRequest2ChInSameSt45 = !gRecoParam->MakeMoreTrackCandidates();
+  }
+  
   // check which chambers are hit
   UInt_t presentStationMask(0);
   Int_t nChHitInSt4 = 0, nChHitInSt5 = 0;
@@ -186,7 +196,7 @@ void add_muon_trackRefs(AliStack* stack, TTree* treeTR, TEveTrackList* reco, TEv
     {
       track->SortPathMarksByTime();
       // stop track propagation at last path mark
-      track->RefPathMarks().back().fType = TEvePathMark::kDecay;
+      track->RefPathMarks().back().fType = TEvePathMarkT<double>::EType_e(TEvePathMark::kDecay);
       
       // add the track and trackRefs to proper lists
       if (isReconstructible(chHit)) {
@@ -238,18 +248,6 @@ void muon_trackRefs(Bool_t showSimClusters)
   TTree* treeTR = rl->TreeTR();  
   if (!treeTR) return;
   
-  // load recoParam from OCDB
-  if (!gRecoParam)
-  {
-    gRecoParam = AliMUONCDB::LoadRecoParam();
-    if (!gRecoParam) return;
-    // compute the mask of requested stations
-    gRequestedStationMask = 0;
-    for (Int_t i = 0; i < 5; i++) if (gRecoParam->RequestStation(i)) gRequestedStationMask |= ( 1 << i );
-    // get whether a track need 2 chambers hit in the same station (4 or 5) or not to be reconstructible
-    gRequest2ChInSameSt45 = !gRecoParam->MakeMoreTrackCandidates();
-  }
-  
   // track containers
   TEveElementList* trackCont = new TEveElementList("Sim MUON Tracks");