RESONANCES/AliRsnMiniAxis.cxx
RESONANCES/AliRsnMiniOutput.cxx
RESONANCES/AliRsnMiniValue.cxx
+ RESONANCES/AliRsnMiniMonitor.cxx
RESONANCES/AliRsnMiniAnalysisTask.cxx )
string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
#pragma link C++ class AliRsnMiniAxis+;
#pragma link C++ class AliRsnMiniOutput+;
#pragma link C++ class AliRsnMiniValue+;
+#pragma link C++ class AliRsnMiniMonitor+;
#pragma link C++ class AliRsnMiniAnalysisTask+;
// check if TOF is matched
// and computes all values used in the PID cut
+ Bool_t accept = kFALSE;
Bool_t isTOF = MatchTOF(track);
Double_t nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track, AliPID::kKaon));
Double_t nsTOF = TMath::Abs(pid->NumberOfSigmasTOF(track, AliPID::kKaon));
// if only one detector is chosen, do this here
if (fOnlyTPC) {
- return (nsTPC <= fCutTPC);
+ AliDebugClass(1, Form("Checking only TPC: nsigma = %f - cut = %f", nsTPC, fCutTPC));
+ accept = (nsTPC <= fCutTPC);
} else if (fOnlyTOF) {
- return (isTOF && (nsTOF <= fCutTOF));
+ if (!isTOF) {
+ AliDebugClass(1, "Checking only TOF: rejecting non-TOF track");
+ accept = kFALSE;
+ } else {
+ AliDebugClass(1, Form("Checking only TOF: nsigma = %f - cut = %f", nsTOF, fCutTOF));
+ accept = (nsTOF <= fCutTOF);
+ }
} else {
// combined PID:
// below momentum threshold, start with TPC
if (track->P() < fTOFthreshold) {
- if (isTOF)
- return ((nsTPC <= fCutTPC) && (nsTOF <= fCutTOF));
- else
- return (nsTPC <= fCutTPC);
+ AliDebugClass(1, Form("Checking both PID: p = %f below threshold (TOF not required)", track->P()));
+ if (isTOF) {
+ AliDebugClass(1, Form("TOF present: nsigmaTPC: = %f - cut = %f", nsTPC, fCutTPC));
+ AliDebugClass(1, Form("TOF present: nsigmaTOF: = %f - cut = %f", nsTOF, fCutTOF));
+ accept = ((nsTPC <= fCutTPC) && (nsTOF <= fCutTOF));
+ } else {
+ AliDebugClass(1, Form("TOF absent : nsigmaTPC: = %f - cut = %f", nsTPC, fCutTPC));
+ accept = (nsTPC <= fCutTPC);
+ }
} else {
- if (isTOF)
- return ((nsTPC <= fCutTPC) && (nsTOF <= fCutTOF));
- else
- return kFALSE;
+ AliDebugClass(1, Form("Checking both PID: p = %f above threshold (TOF required)", track->P()));
+ if (isTOF) {
+ AliDebugClass(1, Form("TOF present: nsigmaTPC: = %f - cut = %f", nsTPC, fCutTPC));
+ AliDebugClass(1, Form("TOF present: nsigmaTOF: = %f - cut = %f", nsTOF, fCutTOF));
+ accept = ((nsTPC <= fCutTPC) && (nsTOF <= fCutTOF));
+ } else {
+ AliDebugClass(1, "TOF absent : track rejected");
+ accept = kFALSE;
+ }
}
}
+
+ AliDebugClass(1, Form("Track %s", (accept ? "accepted" : "rejected")));
+ return accept;
}
ifill++;
if (ifill >= fNMix) break;
}
- //cout << "Matches for event " << Form("%5d", ievt) << ": " << matched[ievt].Data() << " (" << ifill << ")" << endl;
+ AliDebugClass(1, Form("Matches for event %5d = %s", ievt, matched[ievt].Data()));
}
// perform mixing
TObjArrayIter next(list);
while ( (os = (TObjString*)next()) ) {
imix = os->GetString().Atoi();
- //cout << "Mixing " << ievt << " with " << imix << endl;
fEvBuffer->GetEntry(imix);
for (idef = 0; idef < nDefs; idef++) {
def = (AliRsnMiniOutput*)fHistograms[idef];
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// This class contains all code which is used to compute any of the values
+// which can be of interest within a resonance analysis. Besides the obvious
+// invariant mass, it allows to compute other utility values on all possible
+// targets, in order to allow a wide spectrum of binning and checks.
+// When needed, this object can also define a binning in the variable which
+// it is required to compute, which is used for initializing axes of output
+// histograms (see AliRsnFunction).
+// The value computation requires this object to be passed the object whose
+// informations will be used. This object can be of any allowed input type
+// (track, pair, event), then this class must inherit from AliRsnTarget.
+// Then, when value computation is attempted, a check on target type is done
+// and computation is successful only if expected target matches that of the
+// passed object.
+// In some cases, the value computation can require a support external object,
+// which must then be passed to this class. It can be of any type inheriting
+// from TObject.
+//
+// authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
+// M. Vala (martin.vala@cern.ch)
+//
+////////////////////////////////////////////////////////////////////////////////
+
+#include "Riostream.h"
+
+#include "TH1.h"
+#include "TH2.h"
+#include "TH3.h"
+
+#include "AliLog.h"
+
+#include "AliRsnDaughter.h"
+#include "AliRsnEvent.h"
+
+#include "AliRsnMiniMonitor.h"
+
+ClassImp(AliRsnMiniMonitor)
+
+//__________________________________________________________________________________________________
+AliRsnMiniMonitor::AliRsnMiniMonitor() :
+ TNamed(),
+ fType(kTypes),
+ fCutID(-1),
+ fListID(-1),
+ fList(0x0)
+{
+//
+// Dummy constructor
+//
+}
+
+//__________________________________________________________________________________________________
+AliRsnMiniMonitor::AliRsnMiniMonitor(const char *name, EType type, Int_t cutID) :
+ TNamed(name, ""),
+ fType(type),
+ fCutID(cutID),
+ fListID(-1),
+ fList(0x0)
+{
+//
+// Default constructor
+//
+}
+
+//__________________________________________________________________________________________________
+AliRsnMiniMonitor::AliRsnMiniMonitor(const AliRsnMiniMonitor& copy) :
+ TNamed(copy),
+ fType(copy.fType),
+ fCutID(copy.fCutID),
+ fListID(copy.fListID),
+ fList(copy.fList)
+{
+//
+// Copy constructor
+//
+}
+
+//__________________________________________________________________________________________________
+AliRsnMiniMonitor& AliRsnMiniMonitor::operator=(const AliRsnMiniMonitor& copy)
+{
+//
+// Assignment operator
+//
+
+ TNamed::operator=(copy);
+ fType = copy.fType;
+ fCutID = copy.fCutID;
+ fListID = copy.fListID;
+ fList = copy.fList;
+
+ return (*this);
+}
+
+//__________________________________________________________________________________________________
+Bool_t AliRsnMiniMonitor::Init(const char *name, TList *list)
+{
+//
+// Initialize this output histogram and put into the passed list
+//
+
+ // name
+ TString sname(name);
+ sname += '_';
+ sname += GetName();
+
+ // check list
+ fList = list;
+ if (!list) {
+ AliError("No list!");
+ return kFALSE;
+ }
+
+ // reset histogram
+ TH1 *histogram = 0x0;
+
+ switch (fType) {
+ case kdEdxTPCvsP:
+ sname += "_TPCsignal";
+ histogram = new TH2F(sname.Data(), "", 500, 0.0, 5.0, 1000, 0.0, 1000.0);
+ break;
+ case ktimeTOFvsP:
+ sname += "_TOFsignal";
+ histogram = new TH2F(sname.Data(), "", 500, 0.0, 5.0, 1000, -5.0, 5.0);
+ break;
+ default:
+ AliError("Wrong enum type");
+ return kFALSE;
+ }
+
+ // add to list
+ if (histogram && fList) {
+ histogram->Sumw2();
+ fList->Add(histogram);
+ fListID = fList->IndexOf(histogram);
+ AliInfo(Form("Histogram '%s' added to list in slot #%d", histogram->GetName(), fListID));
+ return kTRUE;
+ }
+
+ return kFALSE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliRsnMiniMonitor::Fill(AliRsnDaughter *track, AliRsnEvent *event)
+{
+//
+// Fill the histogram
+//
+
+ // retrieve object from list
+ if (!fList) {
+ AliError("List pointer is NULL");
+ return kFALSE;
+ }
+ TObject *obj = fList->At(fListID);
+ if (!obj) {
+ AliError("List object is NULL");
+ return kFALSE;
+ }
+
+ Double_t valueX, valueY;
+ AliVTrack *vtrack = track->Ref2Vtrack();
+
+ switch (fType) {
+ case kdEdxTPCvsP:
+ if (!vtrack) {
+ AliWarning("Required vtrack for this value");
+ return kFALSE;
+ }
+ valueX = vtrack->GetTPCmomentum();
+ valueY = vtrack->GetTPCsignal();
+ ((TH2F*)obj)->Fill(valueX, valueY);
+ return kTRUE;
+ case ktimeTOFvsP:
+ if (!vtrack) {
+ AliWarning("Required vtrack for this value");
+ return kFALSE;
+ }
+ valueX = vtrack->P();
+ valueY = vtrack->GetTOFsignal();
+ ((TH2F*)obj)->Fill(valueX, valueY);
+ return kTRUE;
+ default:
+ AliError("Invalid value type");
+ return kFALSE;
+ }
+}
--- /dev/null
+#ifndef AliRsnMiniMonitor_H
+#define AliRsnMiniMonitor_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Monitors
+//
+////////////////////////////////////////////////////////////////////////////////
+
+#include "TObjArray.h"
+
+class AliRsnDaughter;
+class AliRsnEvent;
+
+class AliRsnMiniMonitor : public TNamed {
+public:
+
+ enum EType {
+ kdEdxTPCvsP, // TPC signal vs. momentum
+ ktimeTOFvsP, // TOF time vs. momentum
+ kTypes // total number of cuts
+ };
+
+ AliRsnMiniMonitor();
+ AliRsnMiniMonitor(const char *name, EType type, Int_t cutID);
+ AliRsnMiniMonitor(const AliRsnMiniMonitor& copy);
+ AliRsnMiniMonitor& operator=(const AliRsnMiniMonitor& copy);
+ virtual ~AliRsnMiniMonitor() { }
+
+ EType GetType() {return fType;}
+ Int_t GetCutID() {return fCutID;}
+ Int_t GetListID() {return fListID;}
+
+ void SetType(EType type) {fType = type;}
+ void SetCutID(Int_t id) {fCutID = id;}
+
+ static const char* Label(EType type);
+ Bool_t Init(const char *name, TList *list);
+ Bool_t Fill(AliRsnDaughter *track, AliRsnEvent *event);
+
+protected:
+
+ EType fType; // monitor type
+ Int_t fCutID; // ID for cut to be used
+ Int_t fListID; // histogram ID in the list
+ TList *fList; //! global output list
+
+ ClassDef(AliRsnMiniMonitor, 1) // AliRsnMiniMonitor class
+};
+
+inline const char* AliRsnMiniMonitor::Label(EType type)
+{
+ switch (type) {
+ case kdEdxTPCvsP: return "TPCsignal";
+ case ktimeTOFvsP: return "TOFsignal";
+ default : return "X";
+ }
+}
+
+#endif
// it is necessary to know if criteria for the two daughters are the same
// and if the two events are the same or not (mixing)
- Bool_t sameCriteria = ((fCharge[0] == fCharge[1]) && (fCutID[0] == fCutID[1]));
+ //Bool_t sameCriteria = ((fCharge[0] == fCharge[1]) && (fCutID[0] == fCutID[1]));
+ Bool_t sameCriteria = ((fCharge[0] == fCharge[1]) && (fDaughter[0] == fDaughter[1]));
Bool_t sameEvent = (event1->ID() == event2->ID());
Int_t nsel1 = event1->CountParticles(fCharge[0], fCutID[0]);
// the first track *after* current one;
// otherwise it starts from the beginning
start = ((sameEvent && sameCriteria) ? i1 + 1 : 0);
- cout << "START = " << endl;
+ AliDebugClass(2, Form("Start point = %d", start));
// internal loop
for (i2 = start; i2 < n2; i2++) {
p2 = event2->GetParticle(i2);
void SetMotherPDG(Int_t pdg) {fMotherPDG = pdg;}
void SetMotherMass(Double_t mass) {fMotherMass = mass;}
- void SetDef1(AliRsnDaughterDef *def) {if (def) fDef1 = (*def);}
- void SetDef2(AliRsnDaughterDef *def) {if (def) fDef2 = (*def);}
- void SetDef(Int_t i, AliRsnDaughterDef *def) {if (!def) return; if (i<1) fDef1 = (*def); else fDef2 = (*def);}
+ void SetDef1(const AliRsnDaughterDef *def) {if (def) fDef1 = (*def);}
+ void SetDef2(const AliRsnDaughterDef *def) {if (def) fDef2 = (*def);}
+ void SetDef(Int_t i, const AliRsnDaughterDef *def) {if (!def) return; if (i<1) fDef1 = (*def); else fDef2 = (*def);}
Bool_t IsLikeSign() const {return (fDef1.GetChargeC() == fDef2.GetChargeC());}
Bool_t HasEqualPID() const {return (fDef1.GetPID() == fDef2.GetPID());}
+//
+// AliRsnValuePID
+// Implementation of values related to PID
+// which can be used to monitor or check cuts
+// based on tolerance ranges between detector signals
+// and expected responses for particle species
+//
+
#include <Riostream.h>
#include "AliVTrack.h"
#ifndef ALIRSNVALUEPID_H
#define ALIRSNVALUEPID_H
+//
+// AliRsnValuePID
+// Implementation of values related to PID
+// which can be used to monitor or check cuts
+// based on tolerance ranges between detector signals
+// and expected responses for particle species
+//
+
#include "AliPID.h"
#include "AliRsnValue.h"
virtual ~AliRsnValuePID() { }
void SetValuePID(EValuePID type) {fValuePID = type;}
- EValuePID GetValuePID() {return fValuePID;}
+ EValuePID GetValuePID() const {return fValuePID;}
virtual Bool_t Eval(TObject *object, Bool_t useMC = kFALSE);
virtual void Print(Option_t *option = "") const;