]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding getter for closest VZERO-AND interaction record.
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Apr 2013 13:20:23 +0000 (13:20 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Apr 2013 13:20:23 +0000 (13:20 +0000)
STEER/ESD/AliESDHeader.cxx
STEER/ESD/AliESDHeader.h

index 945674026a97f8a6165776484a9e1cff87ffe963..6c7cc37d721b8530b9092860b003580e3c7f10af 100644 (file)
@@ -569,6 +569,40 @@ Int_t AliESDHeader::GetIRInt2ClosestInteractionMap()
   return closest;
 }
 
+//__________________________________________________________________________
+Int_t AliESDHeader::GetIRInt1ClosestInteractionMap(Int_t gap)
+{
+  //
+  // Calculation of the closest interaction
+  // In case of VZERO (Int1) one has to introduce a gap
+  // in order to avoid false positivies from after-pulses
+
+  SetIRInteractionMap();
+
+  Int_t firstNegative=100;
+  for(Int_t item=-1; item>=-90; item--) {
+    Int_t bin = FindIRIntInteractionsBXMap(item);
+    Bool_t isFired = fIRInt1InteractionsMap.TestBitNumber(bin);
+    if(isFired) {
+      firstNegative = item;
+      break;
+    }
+  }
+  Int_t firstPositive=100;
+  for(Int_t item=1+gap; item<=90; item++) {
+    Int_t bin = FindIRIntInteractionsBXMap(item);
+    Bool_t isFired = fIRInt1InteractionsMap.TestBitNumber(bin);
+    if(isFired) {
+      firstPositive = item;
+      break;
+    }
+  }
+
+  Int_t closest = firstPositive < TMath::Abs(firstNegative) ? firstPositive : TMath::Abs(firstNegative);
+  if(firstPositive==100 && firstNegative==100) closest=0;
+  return closest;
+}
+
 //__________________________________________________________________________
 Int_t  AliESDHeader::GetIRInt2LastInteractionMap()
 {
index 2271496e71dc1fb041502254f6b2c1ee2bc87158..69f6dd7907b420f29243b727a7ad3866f24a2c04 100644 (file)
@@ -68,6 +68,7 @@ public:
   TBits  GetIRInt2InteractionMap() { SetIRInteractionMap(); return fIRInt2InteractionsMap; }
   TBits  GetIRInt1InteractionMap() { SetIRInteractionMap(); return fIRInt1InteractionsMap; }
   Int_t  GetIRInt2ClosestInteractionMap();
+  Int_t  GetIRInt1ClosestInteractionMap(Int_t gap = 3);
   Int_t  GetIRInt2LastInteractionMap();
 //**************************************************************************