Added the possibility to save the particle id's through the chain, if detailed effici...
authorvestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 18 Feb 2002 19:55:49 +0000 (19:55 +0000)
committervestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 18 Feb 2002 19:55:49 +0000 (19:55 +0000)
HLT/src/AliL3ClustFinderNew.cxx
HLT/src/AliL3ClustFinderNew.h
HLT/src/AliL3DigitData.h
HLT/src/AliL3FileHandler.cxx
HLT/src/AliL3RootTypes.h
HLT/src/AliL3SpacePointData.h

index b94af6883be6e79b9a1f1d610d43db039a6f2d2d..776865403431bf57719ef418a51b09ff0d37d35c 100644 (file)
@@ -4,11 +4,13 @@
 //*-- Copyright &copy ASV 
 
 #include <iostream.h>
+#include <math.h>
 #include "AliL3Logging.h"
 #include "AliL3ClustFinderNew.h"
 #include "AliL3DigitData.h"
 #include "AliL3Transform.h"
 #include "AliL3SpacePointData.h"
+#include "AliL3MemHandler.h"
 
 //_____________________________________________________________
 // AliL3ClustFinderNew
@@ -327,10 +329,50 @@ void AliL3ClustFinderNew::WriteClusters(Int_t n_clusters,ClusterData *list)
       fSpacePointData[counter].fZErr = fZErr;
       fSpacePointData[counter].fID = counter
        +((fCurrentSlice&0x7f)<<25)+((fCurrentPatch&0x7)<<22);//uli
-      
+#ifdef do_mc
+      Int_t trackID[3];
+      GetTrackID((Int_t)rint(fpad),(Int_t)rint(ftime),trackID);
+      fSpacePointData[counter].fTrackID[0] = trackID[0];
+      fSpacePointData[counter].fTrackID[1] = trackID[1];
+      fSpacePointData[counter].fTrackID[2] = trackID[2];
+#endif
       fNClusters++;
       counter++;
 
     }
 
 }
+
+#ifdef do_mc
+void AliL3ClustFinderNew::GetTrackID(Int_t pad,Int_t time,Int_t *trackID)
+{
+  AliL3DigitRowData *rowPt = (AliL3DigitRowData*)fDigitRowData;
+  
+  trackID[0]=trackID[1]=trackID[2]=-1;
+  //cout<<"Looking for pad "<<pad<<" time "<<time<<endl;
+  for(Int_t i=fFirstRow; i<=fLastRow; i++)
+    {
+      if(rowPt->fRow < (UInt_t)fCurrentRow)
+       {
+         AliL3MemHandler::UpdateRowPointer(rowPt);
+         continue;
+       }
+      AliL3DigitData *digPt = (AliL3DigitData*)rowPt->fDigitData;
+      for(UInt_t j=0; j<rowPt->fNDigit; j++)
+       {
+         Int_t cpad = digPt[j].fPad;
+         Int_t ctime = digPt[j].fTime;
+         if(cpad < pad) continue;
+         if(ctime < time) continue;
+         if(cpad != pad && ctime != ctime) break;
+         //cout<<"Reading row "<<fCurrentRow<<" pad "<<cpad<<" time "<<ctime<<" trackID "<<digPt[j].fTrackID[0]<<endl;
+         trackID[0] = digPt[j].fTrackID[0];
+         trackID[1] = digPt[j].fTrackID[1];
+         trackID[2] = digPt[j].fTrackID[2];
+         //cout<<"Reading trackID "<<trackID[0]<<endl;
+       }
+      break;
+    }
+  
+}
+#endif
index ade4c48e61bbb152166a6c957d01a6690f642db9..4c399868b336a92b73ca9e43bab30afbd12e7436 100644 (file)
@@ -42,6 +42,10 @@ class AliL3ClustFinderNew {
   Int_t fMaxNClusters;
   Float_t fXYErr;
   Float_t fZErr;
+
+#ifdef do_mc
+  void GetTrackID(Int_t pad,Int_t time,Int_t *trackID);
+#endif
   
  public:
   AliL3ClustFinderNew();
index de898516f43201be3b8739efa9e713ae8a89db54..719216bfc8a8ea0b949e5f27e9883d8b58e03bb1 100644 (file)
@@ -5,6 +5,9 @@
 
 struct AliL3DigitData
 {
+#ifdef do_mc
+  Int_t fTrackID[3];
+#endif
   UShort_t fCharge;
   UChar_t fPad;
   UShort_t fTime;
index 3762e2eb1f3b51ecfb2196d504e762438ce33551..4d0e871772baeb9e17d5c4fc397215f341b0aff0 100644 (file)
@@ -40,7 +40,6 @@ AliL3FileHandler::AliL3FileHandler(){
   fDigitsTree=0;
 }
 
-
 AliL3FileHandler::~AliL3FileHandler(){
   //Destructor
   if(fTransformer) delete fTransformer;
@@ -278,6 +277,11 @@ AliL3DigitRowData * AliL3FileHandler::AliDigits2Memory(UInt_t & nrow,Int_t event
         tempPt->fDigitData[localcount].fCharge=dig;
         tempPt->fDigitData[localcount].fPad=pad;
         tempPt->fDigitData[localcount].fTime=time;
+#ifdef do_mc
+       tempPt->fDigitData[localcount].fTrackID[0] = fDigits->GetTrackID(time,pad,0);
+       tempPt->fDigitData[localcount].fTrackID[1] = fDigits->GetTrackID(time,pad,1);
+       tempPt->fDigitData[localcount].fTrackID[2] = fDigits->GetTrackID(time,pad,2);
+#endif
         localcount++;
       } while (fDigits->Next());
 
index 47d16496e6d495669552de3e1829ab90480a156f..24affb866cf8d6f766846d69de65be12b11e0335 100644 (file)
@@ -11,7 +11,9 @@
 #include <math.h>
 
 //#define no_root //switch on the root
-//#define use_aliroot //use AliL3FileHandler
+#define use_aliroot //use AliL3FileHandler
+
+#define do_mc //Save the particle id's.
 
 #ifndef no_root
 #define use_root
index 10783aa7415a3acc6fe4e590150a399971203c87..301bd2ec54e61c5d17b5a728ffd09168b1b62a08 100644 (file)
@@ -3,6 +3,9 @@
 
 #include "AliL3RootTypes.h"
 struct AliL3SpacePointData{
+#ifdef do_mc
+  Int_t fTrackID[3];
+#endif
     Float_t fX;
     Float_t fY;
     Float_t fZ;