header->SetZDCN2Energy(esd.GetZDCN2Energy());
header->SetZDCP2Energy(esd.GetZDCP2Energy());
header->SetZDCEMEnergy(esd.GetZDCEMEnergy(0),esd.GetZDCEMEnergy(1));
+
+ header->SetIRInt2InteractionMap(esd.GetHeader()->GetIRInt2InteractionMap());
+ header->SetIRInt1InteractionMap(esd.GetHeader()->GetIRInt1InteractionMap());
// ITS Cluster Multiplicty
const AliMultiplicity *mult = esd.GetMultiplicity();
fL2TriggerInputs(0),
fTPConlyRefMult(-1),
fCentralityP(0),
- fEventplaneP(0)
+ fEventplaneP(0),
+ fIRInt2InteractionsMap(0),
+ fIRInt1InteractionsMap(0)
{
// default constructor
fL2TriggerInputs(0),
fTPConlyRefMult(-1),
fCentralityP(0),
- fEventplaneP(0)
+ fEventplaneP(0),
+ fIRInt2InteractionsMap(0),
+ fIRInt1InteractionsMap(0)
{
// constructor
fL2TriggerInputs(0),
fTPConlyRefMult(-1),
fCentralityP(0),
- fEventplaneP(0)
+ fEventplaneP(0),
+ fIRInt2InteractionsMap(0),
+ fIRInt1InteractionsMap(0)
{
// constructor
fL2TriggerInputs(hdr.fL2TriggerInputs),
fTPConlyRefMult(hdr.fTPConlyRefMult),
fCentralityP(new AliCentrality(*hdr.fCentralityP)),
- fEventplaneP(new AliEventplane(*hdr.fEventplaneP))
+ fEventplaneP(new AliEventplane(*hdr.fEventplaneP)),
+ fIRInt2InteractionsMap(hdr.fIRInt2InteractionsMap),
+ fIRInt1InteractionsMap(hdr.fIRInt1InteractionsMap)
{
// Copy constructor.
fL2TriggerInputs = hdr.fL2TriggerInputs;
fTPConlyRefMult = hdr.fTPConlyRefMult;
+ fIRInt2InteractionsMap = hdr.fIRInt2InteractionsMap;
+ fIRInt1InteractionsMap = hdr.fIRInt1InteractionsMap;
+
if(hdr.fEventplaneP){
if(fEventplaneP)*fEventplaneP = *hdr.fEventplaneP;
else fEventplaneP = new AliEventplane(*hdr.fEventplaneP);
return;
}
+
+//__________________________________________________________________________
+Int_t AliAODHeader::FindIRIntInteractionsBXMap(Int_t difference)
+{
+ //
+ // The mapping is of 181 bits, from -90 to +90
+ //
+ Int_t bin=-1;
+
+ if(difference<-90 || difference>90) return bin;
+ else { bin = 90 + difference; }
+
+ return bin;
+}
+
+//__________________________________________________________________________
+Int_t AliAODHeader::GetIRInt2ClosestInteractionMap()
+{
+ //
+ // Calculation of the closest interaction
+ //
+ Int_t firstNegative=100;
+ for(Int_t item=-1; item>=-90; item--) {
+ Int_t bin = FindIRIntInteractionsBXMap(item);
+ Bool_t isFired = fIRInt2InteractionsMap.TestBitNumber(bin);
+ if(isFired) {
+ firstNegative = item;
+ break;
+ }
+ }
+ Int_t firstPositive=100;
+ for(Int_t item=1; item<=90; item++) {
+ Int_t bin = FindIRIntInteractionsBXMap(item);
+ Bool_t isFired = fIRInt2InteractionsMap.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 AliAODHeader::GetIRInt2LastInteractionMap()
+{
+ //
+ // Calculation of the last interaction
+ //
+ Int_t lastNegative=0;
+ for(Int_t item=-90; item<=-1; item++) {
+ Int_t bin = FindIRIntInteractionsBXMap(item);
+ Bool_t isFired = fIRInt2InteractionsMap.TestBitNumber(bin);
+ if(isFired) {
+ lastNegative = item;
+ break;
+ }
+ }
+ Int_t lastPositive=0;
+ for(Int_t item=90; item>=1; item--) {
+ Int_t bin = FindIRIntInteractionsBXMap(item);
+ Bool_t isFired = fIRInt2InteractionsMap.TestBitNumber(bin);
+ if(isFired) {
+ lastPositive = item;
+ break;
+ }
+ }
+
+ Int_t last = lastPositive > TMath::Abs(lastNegative) ? lastPositive : TMath::Abs(lastNegative);
+ return last;
+}
#include "AliVHeader.h"
#include "AliAODVertex.h"
#include <TString.h>
+#include <TBits.h>
#include "AliCentrality.h"
#include "AliEventplane.h"
void SetT0spread(Int_t i, Float_t t) {
if ((i>=0)&&(i<kT0SpreadSize)) fT0spread[i]=t;}
+ Int_t FindIRIntInteractionsBXMap(Int_t difference);
+ void SetIRInt2InteractionMap(TBits bits) { fIRInt2InteractionsMap = bits; }
+ void SetIRInt1InteractionMap(TBits bits) { fIRInt1InteractionsMap = bits; }
+ TBits GetIRInt2InteractionMap() { return fIRInt2InteractionsMap; }
+ TBits GetIRInt1InteractionMap() { return fIRInt1InteractionsMap; }
+ Int_t GetIRInt2ClosestInteractionMap();
+ Int_t GetIRInt2LastInteractionMap();
private :
AliEventplane* fEventplaneP; // Pointer to full event plane information
Float_t fVZEROEqFactors[64]; // V0 channel equalization factors for event-plane reconstruction
Float_t fT0spread[kT0SpreadSize]; // spread of time distributions: (TOA+T0C/2), T0A, T0C, (T0A-T0C)/2
- ClassDef(AliAODHeader, 20);
+ TBits fIRInt2InteractionsMap; // map of the Int2 events (normally 0TVX) near the event, that's Int2Id-EventId in a -90 to 90 window
+ TBits fIRInt1InteractionsMap; // map of the Int1 events (normally V0A&V0C) near the event, that's Int1Id-EventId in a -90 to 90 window
+ ClassDef(AliAODHeader, 21);
};
inline
void AliAODHeader::SetCentrality(const AliCentrality* cent) {
fTriggerScalersDeltaRun(),
fTriggerInputsNames(kNTriggerInputs),
fCTPConfig(NULL),
- fIRBufferArray()
+ fIRBufferArray(),
+ fIRInt2InteractionsMap(0),
+ fIRInt1InteractionsMap(0)
{
// default constructor
fTriggerScalersDeltaRun(header.fTriggerScalersDeltaRun),
fTriggerInputsNames(TObjArray(kNTriggerInputs)),
fCTPConfig(header.fCTPConfig),
- fIRBufferArray()
+ fIRBufferArray(),
+ fIRInt2InteractionsMap(header.fIRInt2InteractionsMap),
+ fIRInt1InteractionsMap(header.fIRInt1InteractionsMap)
{
// copy constructor
for(Int_t i = 0; i<kNMaxIR ; i++) {
fTriggerScalers = header.fTriggerScalers;
fTriggerScalersDeltaEvent = header.fTriggerScalersDeltaEvent;
fTriggerScalersDeltaRun = header.fTriggerScalersDeltaRun;
+ fIRInt2InteractionsMap = header.fIRInt2InteractionsMap;
+ fIRInt1InteractionsMap = header.fIRInt1InteractionsMap;
+
delete fCTPConfig;
fCTPConfig = header.fCTPConfig;
fTriggerScalersDeltaEvent.Reset();
fTriggerScalersDeltaRun.Reset();
fTriggerInputsNames.Clear();
+
+ fIRInt2InteractionsMap.ResetAllBits();
+ fIRInt1InteractionsMap.ResetAllBits();
+
delete fCTPConfig;
fCTPConfig = 0;
for(Int_t i=0;i<kNMaxIR;i++)if(fIRArray[i]){
return arr;
}
+
+//__________________________________________________________________________
+void AliESDHeader::SetIRInteractionMap()
+{
+ //
+ // Function to compute the map of interations
+ // within 0TVX (int2) or V0A&V0C (int1) and the Event Id
+ // Note, the zero value is excluded
+ //
+ const AliTriggerIR *ir[5] = {GetTriggerIR(0),GetTriggerIR(1),GetTriggerIR(2),GetTriggerIR(3),GetTriggerIR(4)};
+
+ Long64_t orb = (Long64_t)GetOrbitNumber();
+ Long64_t bc = (Long64_t)GetBunchCrossNumber();
+
+ Long64_t evId = orb*3564 + bc;
+
+ for(Int_t i = 0; i < 5; ++i) {
+ if (ir[i] == NULL || ir[i]->GetNWord() == 0) continue;
+ Long64_t irOrb = (Long64_t)ir[i]->GetOrbit();
+ Bool_t* int2 = ir[i]->GetInt2s();
+ Bool_t* int1 = ir[i]->GetInt1s();
+ UShort_t* bcs = ir[i]->GetBCs();
+ for(UInt_t nW = 0; nW < ir[i]->GetNWord(); ++nW) {
+ Long64_t intId = irOrb*3564 + (Long64_t)bcs[nW];
+ if (int2[nW] == kTRUE) {
+ Int_t item = (intId-evId);
+ Int_t bin = FindIRIntInteractionsBXMap(item);
+ if(bin>=0) {
+ fIRInt2InteractionsMap.SetBitNumber(bin,kTRUE);
+ }
+ }
+ if (int1[nW] == kTRUE) {
+ Int_t item = (intId-evId);
+ Int_t bin = FindIRIntInteractionsBXMap(item);
+ if(bin>=0) {
+ fIRInt1InteractionsMap.SetBitNumber(bin,kTRUE);
+ }
+ }
+ }
+ }
+
+ fIRInt2InteractionsMap.Compact();
+ fIRInt1InteractionsMap.Compact();
+}
+
+//__________________________________________________________________________
+Int_t AliESDHeader::FindIRIntInteractionsBXMap(Int_t difference)
+{
+ //
+ // The mapping is of 181 bits, from -90 to +90
+ //
+ Int_t bin=-1;
+
+ if(difference<-90 || difference>90) return bin;
+ else { bin = 90 + difference; }
+
+ return bin;
+}
+
+//__________________________________________________________________________
+Int_t AliESDHeader::GetIRInt2ClosestInteractionMap()
+{
+ //
+ // Calculation of the closest interaction
+ //
+ SetIRInteractionMap();
+
+ Int_t firstNegative=100;
+ for(Int_t item=-1; item>=-90; item--) {
+ Int_t bin = FindIRIntInteractionsBXMap(item);
+ Bool_t isFired = fIRInt2InteractionsMap.TestBitNumber(bin);
+ if(isFired) {
+ firstNegative = item;
+ break;
+ }
+ }
+ Int_t firstPositive=100;
+ for(Int_t item=1; item<=90; item++) {
+ Int_t bin = FindIRIntInteractionsBXMap(item);
+ Bool_t isFired = fIRInt2InteractionsMap.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()
+{
+ //
+ // Calculation of the last interaction
+ //
+ SetIRInteractionMap();
+
+ Int_t lastNegative=0;
+ for(Int_t item=-90; item<=-1; item++) {
+ Int_t bin = FindIRIntInteractionsBXMap(item);
+ Bool_t isFired = fIRInt2InteractionsMap.TestBitNumber(bin);
+ if(isFired) {
+ lastNegative = item;
+ break;
+ }
+ }
+ Int_t lastPositive=0;
+ for(Int_t item=90; item>=1; item--) {
+ Int_t bin = FindIRIntInteractionsBXMap(item);
+ Bool_t isFired = fIRInt2InteractionsMap.TestBitNumber(bin);
+ if(isFired) {
+ lastPositive = item;
+ break;
+ }
+ }
+
+ Int_t last = lastPositive > TMath::Abs(lastNegative) ? lastPositive : TMath::Abs(lastNegative);
+ return last;
+}
#include <TObjArray.h>
#include <TClonesArray.h>
+#include <TBits.h>
#include "AliVHeader.h"
#include "AliTriggerScalersESD.h"
#include "AliTriggerScalersRecordESD.h"
TString GetFiredTriggerInputs() const;
Bool_t IsTriggerInputFired(const char *name) const;
const AliTriggerConfiguration* GetCTPConfig() const { return fCTPConfig;}
+ void SetIRInteractionMap();
+ Int_t FindIRIntInteractionsBXMap(Int_t difference);
+ TBits GetIRInt2InteractionMap() { SetIRInteractionMap(); return fIRInt2InteractionsMap; }
+ TBits GetIRInt1InteractionMap() { SetIRInteractionMap(); return fIRInt1InteractionsMap; }
+ Int_t GetIRInt2ClosestInteractionMap();
+ Int_t GetIRInt2LastInteractionMap();
//**************************************************************************
ULong64_t GetTriggerMask() const {return fTriggerMask;}
TObjArray fTriggerInputsNames;// Array of TNamed of the active trigger inputs (L0,L1 and L2)
AliTriggerConfiguration* fCTPConfig; // Trigger configuration for the run
TObjArray fIRBufferArray;// Array with interaction records before and after triggered event
+ TBits fIRInt2InteractionsMap; // map of the Int2 events (normally 0TVX) near the event, that's Int2Id-EventId within -90 +90 BXs
+ TBits fIRInt1InteractionsMap; // map of the Int1 events (normally V0A&V0C) near the event, that's Int1Id-EventId within -90 +90 BXs
-
- ClassDef(AliESDHeader,10)
+ ClassDef(AliESDHeader,11)
};
#endif