From caa58e1ad7e2710be3a39cacc822c19108b1cf53 Mon Sep 17 00:00:00 2001 From: nick Date: Thu, 27 Sep 2007 14:35:09 +0000 Subject: [PATCH] 26-sep-2007 NvE AliTrack extended with GetNsignals for a specific signal class. Also AliJet extended with GetNtracks for a specified track name. 27-sep-2007 NvE New memberfunction RemoveDevice() introduced in AliEvent. AliAstrolab derived from TTask, to provide a base class for TTask based processors. New class AliEventSelector introduced. 27-sep-2007 NvE Check for event selection/rejection flag introduced in IceCalibrate.cxx, IceChi2.cxx, IceCleanHits.cxx, IceDwalk.cxx, IceDwalkx.cxx, IceLinefit.cxx, IceMakeHits.cxx, IcePandel.cxx and IceXtalk.cxx. 27-sep-2007 NvE Check for event selection flag introduced in IceF2k.cxx and IceRawTWR.cxx to provide selected event output. --- RALICE/AliAstrolab.cxx | 27 +- RALICE/AliAstrolab.h | 8 +- RALICE/AliEvent.cxx | 14 + RALICE/AliEvent.h | 3 +- RALICE/AliEventSelector.cxx | 1160 +++++++++++++++++++++++ RALICE/AliEventSelector.h | 63 ++ RALICE/AliJet.cxx | 19 +- RALICE/AliJet.h | 3 +- RALICE/AliTrack.cxx | 15 + RALICE/AliTrack.h | 3 +- RALICE/RALICEHeaders.h | 1 + RALICE/RALICELinkDef.h | 1 + RALICE/history.txt | 7 + RALICE/icepack/IceCalibrate.cxx | 10 + RALICE/icepack/IceChi2.cxx | 10 + RALICE/icepack/IceCleanHits.cxx | 10 + RALICE/icepack/IceDwalk.cxx | 11 + RALICE/icepack/IceDwalkx.cxx | 11 + RALICE/icepack/IceLinefit.cxx | 11 + RALICE/icepack/IceMakeHits.cxx | 10 + RALICE/icepack/IcePandel.cxx | 10 + RALICE/icepack/IceXtalk.cxx | 10 + RALICE/icepack/history.txt | 3 + RALICE/icepack/iceconvert/IceF2k.cxx | 13 +- RALICE/icepack/iceconvert/IceRawTWR.cxx | 13 +- RALICE/icepack/iceconvert/history.txt | 2 + RALICE/libRALICE.pkg | 2 +- 27 files changed, 1426 insertions(+), 24 deletions(-) create mode 100644 RALICE/AliEventSelector.cxx create mode 100644 RALICE/AliEventSelector.h diff --git a/RALICE/AliAstrolab.cxx b/RALICE/AliAstrolab.cxx index 5889ae21969..e592793a8f5 100644 --- a/RALICE/AliAstrolab.cxx +++ b/RALICE/AliAstrolab.cxx @@ -19,6 +19,13 @@ // Class AliAstrolab // Virtual lab to correlate measurements with astrophysical phenomena. // +// This class is derived from TTask, but the only reason for this +// is to enable this class to serve as a base class for other TTask +// derived classes (e.g. AliEventSelector) without the need for +// multiple virtual inheritance. +// So, this AliAstrolab class itself does not provide any TTask +// related functionality. +// // The lab can be given a terrestrial location via the usual longitude // and latitude specifications. // Since this class is derived from AliTimestamp, a lab can also be @@ -81,7 +88,7 @@ // Float_t pos[3]={1,90.-b,l}; // r.SetVector(pos,"sph","deg"); // lab.SetUT(1989,7,30,8,14,16,0,0); -// lab->SetSignal(&r,"gal","M",0,-1,"GRB890730"); +// lab.SetSignal(&r,"gal","M",0,-1,"GRB890730"); // // // List all stored objects // lab.ListSignals("equ","M",5); @@ -120,7 +127,7 @@ ClassImp(AliAstrolab) // Class implementation to enable ROOT I/O -AliAstrolab::AliAstrolab(const char* name,const char* title) : TNamed(name,title),AliTimestamp() +AliAstrolab::AliAstrolab(const char* name,const char* title) : TTask(name,title),AliTimestamp() { // Default constructor @@ -153,7 +160,7 @@ AliAstrolab::~AliAstrolab() } } /////////////////////////////////////////////////////////////////////////// -AliAstrolab::AliAstrolab(const AliAstrolab& t) : TNamed(t),AliTimestamp(t) +AliAstrolab::AliAstrolab(const AliAstrolab& t) : TTask(t),AliTimestamp(t) { // Copy constructor @@ -1336,8 +1343,8 @@ void AliAstrolab::PrintSignal(TString frame,TString mode,AliTimestamp* ts,Int_t // The input parameter "mode" also determines which type of time and // local hour angle will appear in the printout. // -// mode = "M" --> Mean Siderial Time (MST) and Local Mean Hour Angle (LMHA) -// "T" --> Apparent Siderial Time (AST) and Local Apparent Hour Angle (LAHA) +// mode = "M" --> Mean Sidereal Time (MST) and Local Mean Hour Angle (LMHA) +// "T" --> Apparent Sidereal Time (AST) and Local Apparent Hour Angle (LAHA) // // The input parameter "jref" allows printing of a so-called "reference" signal. // These reference signals may serve to check space-time event coincidences with the @@ -1487,8 +1494,8 @@ void AliAstrolab::PrintSignal(TString frame,TString mode,AliTimestamp* ts,Int_t // The input parameter "mode" also determines which type of time and // local hour angle will appear in the printout. // -// mode = "M" --> Mean Siderial Time (MST) and Local Mean Hour Angle (LMHA) -// "T" --> Apparent Siderial Time (AST) and Local Apparent Hour Angle (LAHA) +// mode = "M" --> Mean Sidereal Time (MST) and Local Mean Hour Angle (LMHA) +// "T" --> Apparent Sidereal Time (AST) and Local Apparent Hour Angle (LAHA) // // Note : In case ts=0 the current timestamp of the lab will be taken. @@ -1547,10 +1554,8 @@ void AliAstrolab::ListSignals(TString frame,TString mode,Int_t ndig) // The input parameter "mode" also determines which type of time and // local hour angle will appear in the listing. // -// mode = "M" --> Mean Siderial Time (MST) and Local Mean Hour Angle (LMHA) -// "T" --> Apparent Siderial Time (AST) and Local Apparent Hour Angle (LAHA) -// -// Note : In case ts=0 the current timestamp of the lab will be taken. +// mode = "M" --> Mean Sidereal Time (MST) and Local Mean Hour Angle (LMHA) +// "T" --> Apparent Sidereal Time (AST) and Local Apparent Hour Angle (LAHA) Int_t iprint=0; diff --git a/RALICE/AliAstrolab.h b/RALICE/AliAstrolab.h index ca85cd1d09a..6ddbcf994c2 100644 --- a/RALICE/AliAstrolab.h +++ b/RALICE/AliAstrolab.h @@ -8,7 +8,7 @@ #include -#include "TNamed.h" +#include "TTask.h" #include "TString.h" #include "TRotMatrix.h" #include "TObjArray.h" @@ -18,10 +18,10 @@ #include "AliPosition.h" #include "AliSignal.h" -class AliAstrolab : public TNamed,public AliTimestamp +class AliAstrolab : public TTask,public AliTimestamp { public: - AliAstrolab(const char* name="",const char* title=""); // Constructor + AliAstrolab(const char* name="AliAstrolab",const char* title="Generic lab"); // Constructor virtual ~AliAstrolab(); // Destructor AliAstrolab(const AliAstrolab& t); // Copy constructor virtual TObject* Clone(const char* name="") const; // Make a deep copy and provide its pointer @@ -89,6 +89,6 @@ class AliAstrolab : public TNamed,public AliTimestamp void Precess(Ali3Vector& r,AliTimestamp* ts1,AliTimestamp* ts2); // Correct RA and decl. for earth's precession void Nutate(Ali3Vector& r,AliTimestamp* ts); // Correct RA and decl. for earth's nutation - ClassDef(AliAstrolab,1) // Virtual lab to relate measurements with astrophysical phenomena + ClassDef(AliAstrolab,2) // Virtual lab to relate measurements with astrophysical phenomena }; #endif diff --git a/RALICE/AliEvent.cxx b/RALICE/AliEvent.cxx index 1bf159c6f60..c4f33437d6a 100644 --- a/RALICE/AliEvent.cxx +++ b/RALICE/AliEvent.cxx @@ -736,6 +736,20 @@ void AliEvent::AddDevice(TObject& d) } } /////////////////////////////////////////////////////////////////////////// +void AliEvent::RemoveDevice(TObject* d) +{ +// Remove the specified device from the event. + + if (!fDevices || !d) return; + + TObject* obj=fDevices->Remove(d); + if (obj) + { + if (fDevCopy) delete obj; + fDevices->Compress(); + } +} +/////////////////////////////////////////////////////////////////////////// void AliEvent::SetDevCopy(Int_t j) { // (De)activate the creation of private copies of the added devices. diff --git a/RALICE/AliEvent.h b/RALICE/AliEvent.h index 8142e159f5c..19ff1fa5059 100644 --- a/RALICE/AliEvent.h +++ b/RALICE/AliEvent.h @@ -49,6 +49,7 @@ class AliEvent : public AliVertex,public AliTimestamp Int_t GetDevCopy() const; // Provide DevCopy flag value void AddDevice(TObject& d); // Add a device to the event void AddDevice(TObject* d) { if (d) AddDevice(*d); } + void RemoveDevice(TObject* d); // Remove the specified device from the event Int_t GetNdevices() const; // Provide the number of devices Int_t GetNdevices(const char* classname) const; // Provide the number of selected devices void ShowDevices(Int_t mode=1) const; // Provide on overview of the available devices @@ -83,6 +84,6 @@ class AliEvent : public AliVertex,public AliTimestamp TObject* fDisplay; //! Temp. pointer to hold objects which serve event displays TObjArray* fDevs; //! Temp. array to hold references to user selected devices - ClassDef(AliEvent,24) // Creation and investigation of an Alice physics event. + ClassDef(AliEvent,25) // Creation and investigation of an Alice physics event. }; #endif diff --git a/RALICE/AliEventSelector.cxx b/RALICE/AliEventSelector.cxx new file mode 100644 index 00000000000..a425d572bb1 --- /dev/null +++ b/RALICE/AliEventSelector.cxx @@ -0,0 +1,1160 @@ +/************************************************************************** + * 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. * + **************************************************************************/ + +// $Id$ + +/////////////////////////////////////////////////////////////////////////// +// Class AliEventSelector +// TTask based processor to perform generic event selection. +// This class is derived from AliAstrolab in order to also provide event +// selection based on space and time matching with external (astrophysical) +// objects and phenomena. +// +// After having applied the various selection criteria, this processor +// introduces an AliDevice with the name "AliEventSelector" into the event. +// This device contains named signal slots to indicate the settings +// of the various selection parameters. +// One of the slots has the name "Select" and the signal value of this +// slot indicates the final selection result. +// +// value : -1 ==> Event rejected +// 0 ==> Decision unknown (incomplete selection parameters) +// 1 ==> Event selected +// +// Event selection may be performed based on various selection types, +// e.g. individual track observables, total event observables or +// space and time matching with external objects. +// These types can be (de)activated via the SetSelector member function. +// +// The specific selection criteria for each selection type may be +// specified via the SetRange memberfunction. +// +// The logic to be used in the selection process with the various criteria +// is set via the memberfunction SetLogic. +// Obviously, matching of tracks with various external objects is always +// performed in logical "or". +// +// For investigation of individual track observables and/or matching with +// external objects, the user may define a restricted set of tracks to +// be used in the evaluation procedures. The definition of such a restricted +// track set is performed via the memberfunction UseTracks. +// +// Example : +// --------- +// gSystem->Load("ralice"); +// +// AliEventSelector sel; +// sel.SetLabPosition(0.5,-90,"deg"); // The South Pole Neutrino Observatory +// sel.SetLocalFrame(90,180,90,270,0,0); // Local frame has X-axis to the North +// +// sel.SetSelector("astro"); +// sel.SetSelector("track"); +// sel.SetSelector("event"); +// sel.SetLogic("and"); +// sel.UseTracks("*"); +// +// sel.SetRange("track","p",0.5,1e20); // Require at least 500 MeV/c track momentum +// sel.SetRange("event","ntrk","*",1,3); // Only low multiplicity events +// +// // Match with Astrophysical objects within 5 degrees and 10 seconds +// Float_t da=5; +// Float_t dt=10; +// sel.SetAstroMatch(da,dt,"from"); +// +// // Some observed event to be investigated +// AliEvent evt; +// evt.SetUT(1989,7,30,8,14,23,738504,0); +// +// Float_t vec[3]={1,23.8,118.65}; +// Ali3Vector r; +// r.SetVector(vec,"sph","deg"); +// +// AliTrack t; +// t.SetNameTitle("SomeTrack","Just a dummy test track"); +// r*=-1; // Let track originate from specified location +// t.Set3Momentum(r); +// +// evt.AddTrack(t); +// +// // Enter some external (astrophysical) reference signals +// Float_t alpha=194818.0; +// Float_t delta=84400.; +// sel.SetSignal(alpha,delta,"B",1950,"M",-1,"Altair"); +// alpha=124900.0; +// delta=272400.; +// sel.SetSignal(alpha,delta,"B",1950,"M",-1,"NGP"); +// alpha=64508.917; +// delta=-164258.02; +// sel.SetSignal(alpha,delta,"J",2000,"M",-1,"Sirius"); +// alpha=23149.08; +// delta=891550.8; +// sel.SetSignal(alpha,delta,"J",2000,"M",-1,"Polaris"); +// alpha=43600.; +// delta=163100.; +// sel.SetSignal(alpha,delta,"J",2000,"M",-1,"Aldebaran"); +// Float_t l=327.531; +// Float_t b=-35.8903; +// Float_t pos[3]={1,90.-b,l}; +// r.SetVector(pos,"sph","deg"); +// sel.SetUT(1989,7,30,8,14,16,0,0); +// sel.SetSignal(&r,"gal","M",0,-1,"GRB890730"); // This matches our track +// +// // List all stored reference objects +// sel.ListSignals("equ","T",5); +// +// // Let's see what the event selection makes of it +// AliJob q; +// q.Add(&sel); +// q.ListEnvironment(); +// q.ProcessObject(&evt); +// +// AliDevice* evtsel=(AliDevice*)evt.GetDevice("AliEventSelector"); +// if (evtsel) evtsel->Data(); +// +//--- Author: Nick van Eijndhoven 17-sep-2007 Utrecht University +//- Modified: NvE $Date$ Utrecht University +/////////////////////////////////////////////////////////////////////////// + +#include "AliEventSelector.h" +#include "Riostream.h" + +ClassImp(AliEventSelector) // Class implementation to enable ROOT I/O + +AliEventSelector::AliEventSelector(const char* name,const char* title) : AliAstrolab(name,title) +{ +// Default constructor. + + fFirst=1; + fEvt=0; + fParams=0; + fSelect=0; + fTrackflag=0; + fEventflag=0; + fAstroflag=0; + fLogic=0; + fUseNames=0; + fUseNtk=0; + fAstroDa=-1; + fAstroDt=-1; + fAstroDir=0; + + for (Int_t i=0; i<=8; i=i+2) + { + fEventTracks[i]=0; + fEventTracks[i+1]=-1; + if (i<=4) + { + fTrackMomenta[i]=0; + fTrackMomenta[i+1]=-1; + fTrackEnergies[i]=0; + fTrackEnergies[i+1]=-1; + fEventMomenta[i]=0; + fEventMomenta[i+1]=-1; + fEventEnergies[i]=0; + fEventEnergies[i+1]=-1; + } + if (i<=2) + { + fTrackRapidities[i]=0; + fTrackRapidities[i+1]=-1; + } + if (i==0) + { + fTrackMasses[i]=0; + fTrackMasses[i+1]=-1; + fEventMasses[i]=0; + fEventMasses[i+1]=-1; + fTrackCharges[i]=0; + fTrackCharges[i+1]=-1; + fEventCharges[i]=0; + fEventCharges[i+1]=-1; + fTrackDevices[i]=0; + fTrackDevices[i+1]=-1; + fEventDevices[i]=0; + fEventDevices[i+1]=-1; + } + } + fTrackDevClass=""; + fEventDevClass=""; + fEventTrkName=""; +} +/////////////////////////////////////////////////////////////////////////// +AliEventSelector::~AliEventSelector() +{ +// Default destructor. + + if (fParams) + { + delete fParams; + fParams=0; + } + + if (fUseNames) + { + delete fUseNames; + fUseNames=0; + } + if (fUseNtk) + { + delete fUseNtk; + fUseNtk=0; + } +} +/////////////////////////////////////////////////////////////////////////// +AliEventSelector::AliEventSelector(const AliEventSelector& q) : AliAstrolab(q) +{ +// Copy constructor + + fFirst=1; + fEvt=0; + fParams=new AliDevice(*(q.fParams)); + fSelect=q.fSelect; + fTrackflag=q.fTrackflag; + fEventflag=q.fEventflag; + fAstroflag=q.fAstroflag; + fLogic=q.fLogic; + fAstroDa=q.fAstroDa; + fAstroDt=q.fAstroDt; + fAstroDir=q.fAstroDir; + + for (Int_t i=0; i<10; i++) + { + fEventTracks[i]=q.fEventTracks[i]; + + if (i<6) + { + fTrackMomenta[i]=q.fTrackMomenta[i]; + fTrackEnergies[i]=q.fTrackEnergies[i]; + fEventMomenta[i]=q.fEventMomenta[i]; + fEventEnergies[i]=q.fEventEnergies[i]; + } + + if (i<4) fTrackRapidities[i]=q.fTrackRapidities[i]; + + if (i<2) + { + fTrackMasses[i]=q.fTrackMasses[i]; + fEventMasses[i]=q.fEventMasses[i]; + fTrackCharges[i]=q.fTrackCharges[i]; + fEventCharges[i]=q.fEventCharges[i]; + fTrackDevices[i]=q.fTrackDevices[i]; + fEventDevices[i]=q.fEventDevices[i]; + } + } + fTrackDevClass=q.fTrackDevClass; + fEventDevClass=q.fEventDevClass; + fEventTrkName=q.fEventTrkName; +} +/////////////////////////////////////////////////////////////////////////// +void AliEventSelector::SetSelector(TString type,Int_t flag) +{ +// Specify the selection types to be used. +// The various types my be selected in a cumulative way by specification +// of the input argument "type". +// The various possibilities are : +// +// type = "track" ==> Selection based on individual track observables (e.g. Pt) +// "event" ==> Selection based on total event observables (e.g. Invmass) +// "astro" ==> Selection based on correlation with external objects +// +// The specified selection types can be (de)activated via the input +// argument "flag". +// +// flag = 0 ==> Don't use the specified selection type +// 1 ==> Use the specified selection type +// +// For type="astro" the flag>0 value specifies further selections as follows : +// +// flag = 1 ==> Match individual track momentum directions with external (astrophysical) objects +// 2 ==> Match event total momentum direction with external (astrophysical) objects +// 3 ==> Match event position with external (astrophysical) objects +// +// For further details see memberfunction SetAstroMatch. +// +// The default value is flag=1. +// +// Note : In the default constructor all selection types are de-activated. + + if (type=="track") fTrackflag=flag; + if (type=="event") fEventflag=flag; + if (type=="astro") fAstroflag=flag; +} +/////////////////////////////////////////////////////////////////////////// +void AliEventSelector::SetLogic(TString type) +{ +// Set type of the decision logic. +// +// type = "and" ==> Event selection based on logical "and" +// "or" ==> Event selection based on logical "or" +// "nand" ==> Event selection based on logical "nand" +// "nor" ==> Event selection based on logical "nor" +// +// Note : In the default constructor the decision logic is set to "unknown". + + if (type=="and") fLogic=1; + if (type=="or") fLogic=2; + if (type=="nand") fLogic=-1; + if (type=="nor") fLogic=-2; +} +/////////////////////////////////////////////////////////////////////////// +void AliEventSelector::UseTracks(TString name,Int_t n) +{ +// Specification of the track names to be used for the investigation +// of individual track observables and matching with external objects. +// +// name : Specifies the track name (e.g. "IceDwalk") +// In case name="*" all track names will be accepted. + +// n : Specifies the max. number of these tracks to be used +// +// Note : n<0 will use all the existing tracks of the specified name +// +// The default is n=-1. +// +// Consecutive invokations of this memberfunction with different names +// will result in an incremental effect. +// +// Example : +// --------- +// UseTracks("IceDwalk",5); +// UseTracks("IceLinefit",2); +// UseTracks("Pythia"); +// +// This will use the first 5 IceDwalk, the first 2 IceLinefit and all the +// Pythia tracks which are encountered in the event structure. + + if (!fUseNames) + { + fUseNames=new TObjArray(); + fUseNames->SetOwner(); + } + + if (!fUseNtk) fUseNtk=new TArrayI(); + + // Check if this classname has already been specified before + TString s; + Int_t nen=fUseNames->GetEntries(); + for (Int_t i=0; iAt(i); + if (!sx) continue; + s=sx->GetString(); + if (s==name) return; + } + + // New name to be added into the storage + if (nen >= fUseNames->GetSize()) fUseNames->Expand(nen+1); + if (nen >= fUseNtk->GetSize()) fUseNtk->Set(nen+1); + + TObjString* namex=new TObjString(); + namex->SetString(name); + fUseNames->Add(namex); + fUseNtk->AddAt(n,nen); +} +/////////////////////////////////////////////////////////////////////////// +void AliEventSelector::SetAstroMatch(Double_t da,Double_t dt,TString dir) +{ +// Set the parameters for the matching of reference objects. +// +// da : Maximum angular difference in degrees +// dt : Maximum absolute time difference in seconds +// dir : "to" ==> Check the location the track (or event) points to +// "from" ==> Check the location the track (or event) originates from + + fAstroDa=fabs(da); + fAstroDt=fabs(dt); + fAstroDir=0; + if (dir=="to") fAstroDir=1; + if (dir=="from") fAstroDir=-1; + + if (!fParams) fParams=new AliDevice(); + + fParams->AddNamedSlot("AstroDa"); + fParams->AddNamedSlot("AstroDt"); + fParams->AddNamedSlot("AstroDir"); + fParams->SetSignal(fAstroDa,"AstroDa"); + fParams->SetSignal(fAstroDt,"AstroDt"); + fParams->SetSignal(fAstroDir,"AstroDir"); +} +/////////////////////////////////////////////////////////////////////////// +void AliEventSelector::SetRange(TString type,TString obs,Double_t low,Double_t up) +{ +// Set range for the specified observable. +// +// type : Selection type specifier (e.g. "track" or "event"). +// obs : Observable specification. +// low : Lower bound of acceptance range +// up : Upper bound of acceptance range +// +// The various observables that are available for selection criteria are : +// +// obs : "p" ==> Momentum value in GeV/c +// "pt" ==> Transverse momentum value in GeV/c +// "pl" ==> Longitudinal momentum value in GeV/c +// "e" ==> Energy value in GeV +// "et" ==> Transverse momentum value in GeV +// "el" ==> Longitudinal momentum value in GeV +// "m" ==> (Invariant) mass in GeV/c^2 +// "q" ==> Charge (electron charge is defined as -1) +// "y" ==> Rapidity (only for "track") +// "eta" ==> Pseudo-rapidity (only for "track") +// +// Note : When upAddNamedSlot("TrackMinP"); + fParams->AddNamedSlot("TrackMaxP"); + fParams->SetSignal(low,"TrackMinP"); + fParams->SetSignal(up,"TrackMaxP"); + } + if (obs=="pt") + { + fTrackMomenta[2]=low; + fTrackMomenta[3]=up; + fParams->AddNamedSlot("TrackMinPt"); + fParams->AddNamedSlot("TrackMaxPt"); + fParams->SetSignal(low,"TrackMinPt"); + fParams->SetSignal(up,"TrackMaxPt"); + } + if (obs=="pl") + { + fTrackMomenta[4]=low; + fTrackMomenta[5]=up; + fParams->AddNamedSlot("TrackMinPl"); + fParams->AddNamedSlot("TrackMaxPl"); + fParams->SetSignal(low,"TrackMinPl"); + fParams->SetSignal(up,"TrackMaxPl"); + } + if (obs=="e") + { + fTrackEnergies[0]=low; + fTrackEnergies[1]=up; + fParams->AddNamedSlot("TrackMinE"); + fParams->AddNamedSlot("TrackMaxE"); + fParams->SetSignal(low,"TrackMinE"); + fParams->SetSignal(up,"TrackMaxE"); + } + if (obs=="et") + { + fTrackEnergies[2]=low; + fTrackEnergies[3]=up; + fParams->AddNamedSlot("TrackMinEt"); + fParams->AddNamedSlot("TrackMaxEt"); + fParams->SetSignal(low,"TrackMinEt"); + fParams->SetSignal(up,"TrackMaxEt"); + } + if (obs=="el") + { + fTrackEnergies[4]=low; + fTrackEnergies[5]=up; + fParams->AddNamedSlot("TrackMinEl"); + fParams->AddNamedSlot("TrackMaxEl"); + fParams->SetSignal(low,"TrackMinEl"); + fParams->SetSignal(up,"TrackMaxEl"); + } + if (obs=="m") + { + fTrackMasses[0]=low; + fTrackMasses[1]=up; + fParams->AddNamedSlot("TrackMinM"); + fParams->AddNamedSlot("TrackMaxM"); + fParams->SetSignal(low,"TrackMinM"); + fParams->SetSignal(up,"TrackMaxM"); + } + if (obs=="q") + { + fTrackCharges[0]=low; + fTrackCharges[1]=up; + fParams->AddNamedSlot("TrackMinQ"); + fParams->AddNamedSlot("TrackMaxQ"); + fParams->SetSignal(low,"TrackMinQ"); + fParams->SetSignal(up,"TrackMaxQ"); + } + if (obs=="y") + { + fTrackRapidities[0]=low; + fTrackRapidities[1]=up; + fParams->AddNamedSlot("TrackMinY"); + fParams->AddNamedSlot("TrackMaxY"); + fParams->SetSignal(low,"TrackMinY"); + fParams->SetSignal(up,"TrackMaxY"); + } + if (obs=="eta") + { + fTrackRapidities[2]=low; + fTrackRapidities[3]=up; + fParams->AddNamedSlot("TrackMinEta"); + fParams->AddNamedSlot("TrackMaxEta"); + fParams->SetSignal(low,"TrackMinEta"); + fParams->SetSignal(up,"TrackMaxEta"); + } + } + + if (type=="event") // Total event observables + { + if (obs=="p") + { + fEventMomenta[0]=low; + fEventMomenta[1]=up; + fParams->AddNamedSlot("EventMinP"); + fParams->AddNamedSlot("EventMaxP"); + fParams->SetSignal(low,"EventMinP"); + fParams->SetSignal(up,"EventMaxP"); + } + if (obs=="pt") + { + fEventMomenta[2]=low; + fEventMomenta[3]=up; + fParams->AddNamedSlot("EventMinPt"); + fParams->AddNamedSlot("EventMaxPt"); + fParams->SetSignal(low,"EventMinPt"); + fParams->SetSignal(up,"EventMaxPt"); + } + if (obs=="pl") + { + fEventMomenta[4]=low; + fEventMomenta[5]=up; + fParams->AddNamedSlot("EventMinPl"); + fParams->AddNamedSlot("EventMaxPl"); + fParams->SetSignal(low,"EventMinPl"); + fParams->SetSignal(up,"EventMaxPl"); + } + if (obs=="e") + { + fEventEnergies[0]=low; + fEventEnergies[1]=up; + fParams->AddNamedSlot("EventMinE"); + fParams->AddNamedSlot("EventMaxE"); + fParams->SetSignal(low,"EventMinE"); + fParams->SetSignal(up,"EventMaxE"); + } + if (obs=="et") + { + fEventEnergies[2]=low; + fEventEnergies[3]=up; + fParams->AddNamedSlot("EventMinEt"); + fParams->AddNamedSlot("EventMaxEt"); + fParams->SetSignal(low,"EventMinEt"); + fParams->SetSignal(up,"EventMaxEt"); + } + if (obs=="el") + { + fEventEnergies[4]=low; + fEventEnergies[5]=up; + fParams->AddNamedSlot("EventMinEl"); + fParams->AddNamedSlot("EventMaxEl"); + fParams->SetSignal(low,"EventMinEl"); + fParams->SetSignal(up,"EventMaxEl"); + } + if (obs=="m") + { + fEventMasses[0]=low; + fEventMasses[1]=up; + fParams->AddNamedSlot("EventMinM"); + fParams->AddNamedSlot("EventMaxM"); + fParams->SetSignal(low,"EventMinM"); + fParams->SetSignal(up,"EventMaxM"); + } + if (obs=="q") + { + fEventCharges[0]=low; + fEventCharges[1]=up; + fParams->AddNamedSlot("EventMinQ"); + fParams->AddNamedSlot("EventMaxQ"); + fParams->SetSignal(low,"EventMinQ"); + fParams->SetSignal(up,"EventMaxQ"); + } + } +} +/////////////////////////////////////////////////////////////////////////// +void AliEventSelector::SetRange(TString type,TString obs,TString name,Int_t nlow,Int_t nup) +{ +// Set range for the specified observable. +// +// type : Selection type specifier (e.g. "track" or "event"). +// obs : Observable specification. +// name : (Class) name of the objects to be searched for +// nlow : Lower bound of acceptance range +// nup : Upper bound of acceptance range +// +// The various observables that are available for selection criteria are : +// +// obs : "ndev" ==> Number of associated devices of the specified (derived) class name +// "ntrk" ==> Number of tracks with the specified name (name="*" ==> all tracks) +// "ntkc" ==> Total number of charged tracks (no name selection) +// "ntk0" ==> Total number of neutral tracks (no name selection) +// "ntk+" ==> Total number of positive tracks (no name selection) +// "ntk-" ==> Total number of negative tracks (no name selection) +// +// Note : For a certain (type,obs) combination only one (class) name can be specified. + + if (!fParams) fParams=new AliDevice(); + + if (type=="track") // Individual track observables + { + if (obs=="ndev") + { + fTrackDevices[0]=nlow; + fTrackDevices[1]=nup; + fTrackDevClass=name; + fParams->AddNamedSlot("TrackMinNdev"); + fParams->AddNamedSlot("TrackMaxNdev"); + fParams->SetSignal(float(nlow),"TrackMinNdev"); + fParams->SetSignal(float(nup),"TrackMaxNdev"); + } + } + + if (type=="event") // Total event observables + { + if (obs=="ndev") + { + fEventDevices[0]=nlow; + fEventDevices[1]=nup; + fEventDevClass=name; + fParams->AddNamedSlot("EventMinNdev"); + fParams->AddNamedSlot("EventMaxNdev"); + fParams->SetSignal(float(nlow),"EventMinNdev"); + fParams->SetSignal(float(nup),"EventMaxNdev"); + } + if (obs=="ntrk") + { + fEventTracks[0]=nlow; + fEventTracks[1]=nup; + fEventTrkName=name; + fParams->AddNamedSlot("EventMinNtrk"); + fParams->AddNamedSlot("EventMaxNtrk"); + fParams->SetSignal(float(nlow),"EventMinNtrk"); + fParams->SetSignal(float(nup),"EventMaxNtrk"); + } + if (obs=="ntkc") + { + fEventTracks[2]=nlow; + fEventTracks[3]=nup; + fParams->AddNamedSlot("EventMinNtkc"); + fParams->AddNamedSlot("EventMaxNtkc"); + fParams->SetSignal(float(nlow),"EventMinNtkc"); + fParams->SetSignal(float(nup),"EventMaxNtkc"); + } + if (obs=="ntk0") + { + fEventTracks[4]=nlow; + fEventTracks[5]=nup; + fParams->AddNamedSlot("EventMinNtk0"); + fParams->AddNamedSlot("EventMaxNtk0"); + fParams->SetSignal(float(nlow),"EventMinNtk0"); + fParams->SetSignal(float(nup),"EventMaxNtk0"); + } + if (obs=="ntk+") + { + fEventTracks[6]=nlow; + fEventTracks[7]=nup; + fParams->AddNamedSlot("EventMinNtk+"); + fParams->AddNamedSlot("EventMaxNtk+"); + fParams->SetSignal(float(nlow),"EventMinNtk+"); + fParams->SetSignal(float(nup),"EventMaxNtk+"); + } + if (obs=="ntk-") + { + fEventTracks[8]=nlow; + fEventTracks[9]=nup; + fParams->AddNamedSlot("EventMinNtk-"); + fParams->AddNamedSlot("EventMaxNtk-"); + fParams->SetSignal(float(nlow),"EventMinNtk-"); + fParams->SetSignal(float(nup),"EventMaxNtk-"); + } + } +} +/////////////////////////////////////////////////////////////////////////// +void AliEventSelector::Exec(Option_t* opt) +{ +// Implementation of the event selection procedures. + + TString name=opt; + AliJob* parent=(AliJob*)(gROOT->GetListOfTasks()->FindObject(name.Data())); + + if (!parent) return; + + fEvt=(AliEvent*)parent->GetObject("AliEvent"); + if (!fEvt) return; + + Int_t ntkmax=0; // Max. number of tracks for a certain name + Int_t nnames=0; // Number of track names to be processed + if (fUseNames) nnames=fUseNames->GetEntries(); + TObjString* strx=0; + TString str; + + if (fFirst) + { + cout << " *AliEventSelector* Selection parameters." << endl; + cout << " Selection types in use :"; + if (fTrackflag) cout << " track"; + if (fEventflag) cout << " event"; + if (fAstroflag) cout << " astro"; + if (!fTrackflag && !fEventflag && !fAstroflag) cout << " none"; + cout << endl; + cout << " Selection logic in use :"; + if (fLogic==1) cout << " and"; + if (fLogic==2) cout << " or"; + if (fLogic==-1) cout << " nand"; + if (fLogic==-2) cout << " nor"; + if (!fLogic) cout << " unknown"; + cout << endl; + if (nnames) cout << " Track name selections to be processed (-1=all)." << endl; + for (Int_t i=0; iAt(i); + if (!strx) continue; + str=strx->GetString(); + ntkmax=fUseNtk->At(i); + cout << " Maximally " << ntkmax << " track(s) per event of name : " << str.Data() << endl; + } + cout << endl; + + fFirst=0; + } + + // Storage of the used parameters in the AliEventSelector device + if (!fParams) fParams=new AliDevice(); + fParams->SetNameTitle("AliEventSelector","AliEventSelector processor parameters"); + + fSelect=0; + if (fLogic) + { + if (fEventflag) Event(); // Check criteria for total event observables + if (fTrackflag) Track(0); // Check criteria for total track observables + if (fAstroflag) Astro(); // Check for matches with external objects + } + + if (fLogic<0) fSelect*=-1; // In case of "nand"/"nor" logic + + fParams->AddNamedSlot("Logic"); + fParams->SetSignal(float(fLogic),"Logic"); + fParams->AddNamedSlot("Eventflag"); + fParams->SetSignal(float(fEventflag),"Eventflag"); + fParams->AddNamedSlot("Trackflag"); + fParams->SetSignal(float(fTrackflag),"Trackflag"); + fParams->AddNamedSlot("Astroflag"); + fParams->SetSignal(float(fAstroflag),"Astroflag"); + fParams->AddNamedSlot("Select"); + fParams->SetSignal(float(fSelect),"Select"); + + AliDevice* dx=(AliDevice*)fEvt->GetDevice("AliEventSelector"); + if (dx) fEvt->RemoveDevice(dx); + fEvt->AddDevice(fParams); +} +/////////////////////////////////////////////////////////////////////////// +void AliEventSelector::Track(Int_t mode) +{ +// Check criteria for individual track observables. +// This memberfunction serves also the track direction checking +// for external (astrophysical) objects. +// mode = 0 : Track observables (e.g. P, Pt etc...) are checked +// 1 : Track direction is checked w.r.t. external (astrophysical) objects + + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + + if (fSelect>0) return; // Event is already flagged as select + + if (!fUseNames) return; + + if (mode==1 && !fAstroDir) return; + + Int_t nnames=fUseNames->GetEntries(); // Number of track names to be processed + Int_t ntkmax=0; // Max. number of tracks for a certain name + TObjString* strx=0; + TString str; + Int_t ntk; + + AliTrack* track=0; + AliTimestamp* ts=0; + Ali3Vector p; + TObjArray* tracks=0; + Double_t val; + Int_t ival; + for (Int_t i=0; iAt(i); + if (!strx) continue; + str=strx->GetString(); + ntkmax=fUseNtk->At(i); + if (str=="*") + { + tracks=fEvt->GetTracks(); + } + else + { + tracks=fEvt->GetTracks(str); + } + ntk=0; + if (tracks) ntk=tracks->GetEntries(); + if (ntkmax>0 && ntk>ntkmax) ntk=ntkmax; + + for (Int_t jtk=0; jtkAt(jtk); + if (!track) continue; + + if (!mode) // Check track observables + { + if (fTrackMomenta[1]>fTrackMomenta[0]) // Selection on P + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=track->GetMomentum(1); + if (val>=fTrackMomenta[0] && val<=fTrackMomenta[1]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fTrackMomenta[3]>fTrackMomenta[2]) // Selection on Pt + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=track->GetPt(1); + if (val>=fTrackMomenta[2] && val<=fTrackMomenta[3]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fTrackMomenta[5]>fTrackMomenta[4]) // Selection on Pl + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=track->GetPl(1); + if (val>=fTrackMomenta[4] && val<=fTrackMomenta[5]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fTrackEnergies[1]>fTrackEnergies[0]) // Selection on E + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=track->GetEnergy(1); + if (val>=fTrackEnergies[0] && val<=fTrackEnergies[1]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fTrackEnergies[3]>fTrackEnergies[2]) // Selection on Et + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=track->GetEt(1); + if (val>=fTrackEnergies[2] && val<=fTrackEnergies[3]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fTrackEnergies[5]>fTrackEnergies[4]) // Selection on El + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=track->GetEl(1); + if (val>=fTrackEnergies[4] && val<=fTrackEnergies[5]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fTrackMasses[1]>fTrackMasses[0]) // Selection on M + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=track->GetMass(1); + if (val>=fTrackMasses[0] && val<=fTrackMasses[1]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fTrackCharges[1]>fTrackCharges[0]) // Selection on Q + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=track->GetCharge(); + if (val>=fTrackCharges[0] && val<=fTrackCharges[1]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fTrackRapidities[1]>fTrackRapidities[0]) // Selection on Y + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=track->GetRapidity(); + if (val>=fTrackRapidities[0] && val<=fTrackRapidities[1]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fTrackRapidities[3]>fTrackRapidities[2]) // Selection on Eta + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=track->GetPseudoRapidity(); + if (val>=fTrackRapidities[2] && val<=fTrackRapidities[3]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fTrackDevices[1]>fTrackDevices[0]) // Selection on Ndev + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + ival=track->GetNsignals(fTrackDevClass.Data()); + if (ival>=fTrackDevices[0] && ival<=fTrackDevices[1]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + } + if (mode==1) // Check track direction w.r.t. external (astrophysical) objects + { + p=track->Get3Momentum(); + if (fAstroDir<0) p*=-1; + ts=track->GetTimestamp(); + if (!ts) ts=(AliTimestamp*)fEvt; + + SetSignal(&p,"loc","T",ts,0,"Track"); + TArrayI* arr=MatchRefSignal(fAstroDa,"deg",fAstroDt,"s"); + if (arr) + { + fSelect=1; + return; + } + } + } // End of loop over tracks of a certain name + } // End of loop over selected track names +} +/////////////////////////////////////////////////////////////////////////// +void AliEventSelector::Event() +{ +// Check criteria for total event observables. + + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + + if (fSelect>0) return; // Event is already flagged as select + + Double_t val=0; + Int_t ival=0; + if (fEventMomenta[1]>fEventMomenta[0]) // Selection on P + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=fEvt->GetMomentum(1); + if (val>=fEventMomenta[0] && val<=fEventMomenta[1]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fEventMomenta[3]>fEventMomenta[2]) // Selection on Pt + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=fEvt->GetPt(1); + if (val>=fEventMomenta[2] && val<=fEventMomenta[3]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fEventMomenta[5]>fEventMomenta[4]) // Selection on Pl + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=fEvt->GetPl(1); + if (val>=fEventMomenta[4] && val<=fEventMomenta[5]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fEventEnergies[1]>fEventEnergies[0]) // Selection on E + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=fEvt->GetEnergy(1); + if (val>=fEventEnergies[0] && val<=fEventEnergies[1]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fEventEnergies[3]>fEventEnergies[2]) // Selection on Et + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=fEvt->GetEt(1); + if (val>=fEventEnergies[2] && val<=fEventEnergies[3]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fEventEnergies[5]>fEventEnergies[4]) // Selection on El + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=fEvt->GetEl(1); + if (val>=fEventEnergies[4] && val<=fEventEnergies[5]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fEventMasses[1]>fEventMasses[0]) // Selection on Minv + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=fEvt->GetInvmass(1); + if (val>=fEventMasses[0] && val<=fEventMasses[1]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fEventCharges[1]>fEventCharges[0]) // Selection on Q + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + val=fEvt->GetCharge(); + if (val>=fEventCharges[0] && val<=fEventCharges[1]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fEventDevices[1]>fEventDevices[0]) // Selection on Ndev + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + ival=fEvt->GetNdevices(fEventDevClass.Data()); + if (ival>=fEventDevices[0] && ival<=fEventDevices[1]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fEventTracks[1]>fEventTracks[0]) // Selection on Ntrk + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + if (fEventTrkName=="*") + { + ival=fEvt->GetNtracks(); + } + else + { + ival=fEvt->GetNtracks(fEventTrkName); + } + if (ival>=fEventTracks[0] && ival<=fEventTracks[1]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fEventTracks[3]>fEventTracks[2]) // Selection on Ntkc + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + ival=fEvt->GetNtracks(0,3,0); + if (ival>=fEventTracks[2] && ival<=fEventTracks[3]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fEventTracks[5]>fEventTracks[4]) // Selection on Ntk0 + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + ival=fEvt->GetNtracks(0,0,0); + if (ival>=fEventTracks[4] && ival<=fEventTracks[5]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fEventTracks[7]>fEventTracks[6]) // Selection on Ntk+ + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + ival=fEvt->GetNtracks(0,1,0); + if (ival>=fEventTracks[6] && ival<=fEventTracks[7]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } + if (fEventTracks[9]>fEventTracks[8]) // Selection on Ntk- + { + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + ival=fEvt->GetNtracks(0,-1,0); + if (ival>=fEventTracks[8] && ival<=fEventTracks[9]) + { + fSelect=1; + if (abs(fLogic)==2) return; // Selections are made in logical "(n)or" + } + } +} +/////////////////////////////////////////////////////////////////////////// +void AliEventSelector::Astro() +{ +// Check for matches with external objects. + + if (abs(fLogic)==1) fSelect=-1; // Selections are made in logical "(n)and" + + if (fSelect>0) return; // Event is already flagged as select + + // Check track directions w.r.t. external (astrophysical) objects + if (fAstroflag==1) + { + Track(1); + return; + } + + // Check total event momentum direction w.r.t. external (astrophysical) objects + if (fAstroflag==2) + { + Ali3Vector p; + p=fEvt->Get3Momentum(); + if (fAstroDir<0) p*=-1; + SetSignal(&p,"loc","T",(AliTimestamp*)fEvt,0,"Event"); + TArrayI* arr=MatchRefSignal(fAstroDa,"deg",fAstroDt,"s"); + if (arr && fLogic) fSelect=1; + return; + } + + // Check event position w.r.t. external (astrophysical) objects + if (fAstroflag==3) + { + SetSignal((Ali3Vector*)fEvt,"loc","T",(AliTimestamp*)fEvt,0,"Event"); + TArrayI* arr=MatchRefSignal(fAstroDa,"deg",fAstroDt,"s"); + if (arr && fLogic) fSelect=1; + return; + } +} +/////////////////////////////////////////////////////////////////////////// +TObject* AliEventSelector::Clone(const char* name) const +{ +// Make a deep copy of the current object and provide the pointer to the copy. +// This memberfunction enables automatic creation of new objects of the +// correct type depending on the object type, a feature which may be very useful +// for containers when adding objects in case the container owns the objects. + + AliEventSelector* sel=new AliEventSelector(*this); + if (name) + { + if (strlen(name)) sel->SetName(name); + } + return sel; +} +/////////////////////////////////////////////////////////////////////////// diff --git a/RALICE/AliEventSelector.h b/RALICE/AliEventSelector.h new file mode 100644 index 00000000000..5bc190e9c5a --- /dev/null +++ b/RALICE/AliEventSelector.h @@ -0,0 +1,63 @@ +#ifndef ALIEVENTSELECTOR_H +#define ALIEVENTSELECTOR_H + +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +// $Id$ + +#include "AliJob.h" +#include "AliAstrolab.h" +#include "AliEvent.h" + +class AliEventSelector : public AliAstrolab +{ + public : + AliEventSelector(const char* name="AliEventSelector",const char* title="Event selection"); // Constructor + virtual ~AliEventSelector(); // Destructor + AliEventSelector(const AliEventSelector& q); // Copy constructor + virtual TObject* Clone(const char* name="") const; // Make a deep copy and provide its pointer + virtual void Exec(Option_t* opt); // Event selection + void SetSelector(TString type,Int_t flag=1); // Specify selection types to be used + void SetLogic(TString type); // Set type of decision logic + void UseTracks(TString name,Int_t n=-1); // Specify track names to be used + void SetAstroMatch(Double_t da,Double_t dt,TString dir); // Set parameters for Astro matching + void SetRange(TString type,TString obs,Double_t low,Double_t up); // Set range of various observables + void SetRange(TString type,TString obs,TString name,Int_t nlow,Int_t nup); // Set range of various observables + + protected : + Int_t fFirst; // Flag to indicate first invokation + AliEvent* fEvt; // Pointer to the current event structure + AliDevice* fParams; // The device containing all parameter settings and final select flag + Int_t fTrackflag; // Flag to indicate usage of individual track selection criteria + Int_t fEventflag; // Flag to indicate usage of total event selection criteria + Int_t fAstroflag; // Flag to indicate usage of Astrolab selection criteria + Int_t fLogic; // Decision logic (0=unknown 1=and 2=or) + TObjArray* fUseNames; // The track names to be used + TArrayI* fUseNtk; // The max. numbers of the various track names to be used + Int_t fSelect; // Event selection flag (-1=reject 0=unknown 1=accept) + Double_t fAstroDa; // Maximum angular distance (deg.) w.r.t. the reference object + Double_t fAstroDt; // Maximum absolute time difference (sec.) w.r.t. the reference signal + Int_t fAstroDir; // Direction flag for pointing to external objects + Float_t fTrackCharges[2]; // Track charge range selections + Float_t fTrackMasses[2]; // Track mass range selections + Double_t fTrackMomenta[6]; // Track momentum range selections + Double_t fTrackEnergies[6]; // Track energy range selections + Double_t fTrackRapidities[4]; // Track rapidity range selections + Int_t fTrackDevices[2]; // Range of number of track associated devices + TString fTrackDevClass; // (Derived) class name of track associated devices + Float_t fEventCharges[2]; // Event charge range selections + Float_t fEventMasses[2]; // Event mass range selections + Double_t fEventMomenta[6]; // Event momentum range selections + Double_t fEventEnergies[6]; // Event energy range selections + Int_t fEventDevices[2]; // Range of number of event associated devices + TString fEventDevClass; // (Derived) class name of event associated devices + Int_t fEventTracks[10]; // Range of number of various track types + TString fEventTrkName; // Name of the tracks for total number of tracks selection + void Track(Int_t mode); // Check criteria for individual track observables + void Event(); // Check criteria for total event observables + void Astro(); // Check for matches with external (astrophysical) objects + + ClassDef(AliEventSelector,1) // TTask derived class to perform generic event selection +}; +#endif diff --git a/RALICE/AliJet.cxx b/RALICE/AliJet.cxx index 9d610abd300..b6f8251cb52 100644 --- a/RALICE/AliJet.cxx +++ b/RALICE/AliJet.cxx @@ -455,11 +455,28 @@ Int_t AliJet::GetNtracks(Int_t idmode,Int_t chmode,Int_t pcode) else { TObjArray* arr=GetTracks(idmode,chmode,pcode); - n=arr->GetEntries(); + if (arr) n=arr->GetEntries(); return n; } } /////////////////////////////////////////////////////////////////////////// +Int_t AliJet::GetNtracks(TString name) +{ +// Provide the number of tracks with the specified name. +// +// Note : +// ------ +// This facility invokes the corresponding GetTracks memberfunction +// and as such may result in overwriting existing track selection +// arrays. Please refer to the docs of GetTracks for further details. + + Int_t n=0; + + TObjArray* arr=GetTracks(name); + if (arr) n=arr->GetEntries(); + return n; +} +/////////////////////////////////////////////////////////////////////////// Double_t AliJet::GetEnergy(Float_t scale) { // Return the total energy of the jet. diff --git a/RALICE/AliJet.h b/RALICE/AliJet.h index 392f0f2fb98..aed1386f729 100644 --- a/RALICE/AliJet.h +++ b/RALICE/AliJet.h @@ -34,6 +34,7 @@ class AliJet : public TNamed,public Ali4Vector Double_t GetInvmass(Float_t scale=-1); // Provide the invariant mass Float_t GetCharge() const; // Provide the total charge of the jet Int_t GetNtracks(Int_t idmode=0,Int_t chmode=2,Int_t pcode=0); // Provide the number of selected tracks in the jet + Int_t GetNtracks(TString name); // Provide the number of tracks with a certain name AliTrack* GetTrack(Int_t i) const; // Provide i-th track of the jet (1=first track) AliTrack* GetIdTrack(Int_t id) const; // Provide the track with user identifier "id" TObjArray* GetTracks(Int_t idmode=0,Int_t chmode=2,Int_t pcode=0); // Provide references to selected tracks @@ -80,6 +81,6 @@ class AliJet : public TNamed,public Ali4Vector TObjArray* fSelected; //! Temp. array to hold user selected or ordered objects Float_t fEscale; // The scale of the energy/momentum units of the jet - ClassDef(AliJet,19) // Creation and investigation of a jet of particle tracks. + ClassDef(AliJet,20) // Creation and investigation of a jet of particle tracks. }; #endif diff --git a/RALICE/AliTrack.cxx b/RALICE/AliTrack.cxx index 380ab98f49a..fb3c4d85195 100644 --- a/RALICE/AliTrack.cxx +++ b/RALICE/AliTrack.cxx @@ -840,6 +840,21 @@ Int_t AliTrack::GetNsignals() const return nsig; } /////////////////////////////////////////////////////////////////////////// +Int_t AliTrack::GetNsignals(const char* classname) const +{ +// Provide the number of stored signals of the specified class. + + Int_t nsigs=0; + for (Int_t isig=1; isig<=GetNsignals(); isig++) + { + TObject* obj=GetSignal(isig); + if (!obj) continue; + + if (obj->InheritsFrom(classname)) nsigs++; + } + return nsigs; +} +/////////////////////////////////////////////////////////////////////////// AliSignal* AliTrack::GetSignal(Int_t j) const { // Provide the related AliSignal number j. diff --git a/RALICE/AliTrack.h b/RALICE/AliTrack.h index e57cbc5ff24..3e2ed7b2408 100644 --- a/RALICE/AliTrack.h +++ b/RALICE/AliTrack.h @@ -46,6 +46,7 @@ class AliTrack : public TNamed,public Ali4Vector void RemoveSignal(AliSignal& s,Int_t mode=1); // Remove related AliSignal from this track void RemoveSignals(Int_t mode=1); // Remove all related AliSignals from this track Int_t GetNsignals() const; // Provide number of related AliSignals + Int_t GetNsignals(const char* classname) const; // Provide the number of selected signals AliSignal* GetSignal(Int_t j) const; // Access to the related AliSignal number j void SetBeginPoint(AliPosition& p); // Set the track begin-point AliPosition* GetBeginPoint(); // Provide the track begin-point @@ -114,6 +115,6 @@ class AliTrack : public TNamed,public Ali4Vector private: void Dumps(AliTrack* t,Int_t n,TString f,TString u); // Recursively print all decay levels - ClassDef(AliTrack,20) // Handling of the attributes of a reconstructed particle track. + ClassDef(AliTrack,21) // Handling of the attributes of a reconstructed particle track. }; #endif diff --git a/RALICE/RALICEHeaders.h b/RALICE/RALICEHeaders.h index 23cc2bdd47b..c20c3937d87 100644 --- a/RALICE/RALICEHeaders.h +++ b/RALICE/RALICEHeaders.h @@ -37,3 +37,4 @@ #include "AliTimestamp.h" #include "AliJob.h" #include "AliAstrolab.h" +#include "AliEventSelector.h" diff --git a/RALICE/RALICELinkDef.h b/RALICE/RALICELinkDef.h index 2e1b9557b7b..aef7cb10864 100644 --- a/RALICE/RALICELinkDef.h +++ b/RALICE/RALICELinkDef.h @@ -42,5 +42,6 @@ #pragma link C++ class AliTimestamp+; #pragma link C++ class AliJob+; #pragma link C++ class AliAstrolab+; + #pragma link C++ class AliEventSelector+; #endif diff --git a/RALICE/history.txt b/RALICE/history.txt index f3a8e3283df..309b7cca6f9 100644 --- a/RALICE/history.txt +++ b/RALICE/history.txt @@ -782,3 +782,10 @@ 13-sep-2007 NvE New class AliAstrolab introduced to relate (local) measurements with astrophysical phenomena. 13-sep-2007 NvE Hour angle info included in printout of AliAstrolab. +26-sep-2007 NvE AliTrack extended with GetNsignals for a specific signal class. + Also AliJet extended with GetNtracks for a specified track name. +27-sep-2007 NvE New memberfunction RemoveDevice() introduced in AliEvent. + AliAstrolab derived from TTask, to provide a base class for TTask + based processors. + New class AliEventSelector introduced. + diff --git a/RALICE/icepack/IceCalibrate.cxx b/RALICE/icepack/IceCalibrate.cxx index 956923fb55c..3538c2dedae 100644 --- a/RALICE/icepack/IceCalibrate.cxx +++ b/RALICE/icepack/IceCalibrate.cxx @@ -19,6 +19,9 @@ // Class IceCalibrate // TTask derived class to perform the various calibrations. // +// In case an event has been rejected by an AliEventSelector (based) processor, +// this task (and its sub-tasks) is not executed. +// // This task takes the current event in memory and uses the attached // OM database to access the various calibration functions. // A specific OM database may be attached by means of the SetOMdbase() @@ -104,6 +107,13 @@ void IceCalibrate::Exec(Option_t* opt) IceEvent* evt=(IceEvent*)parent->GetObject("IceEvent"); if (!evt) return; + // Only process accepted events + AliDevice* seldev=(AliDevice*)evt->GetDevice("AliEventSelector"); + if (seldev) + { + if (seldev->GetSignal("Select") < 0.1) return; + } + Int_t mudaq=0; Int_t twrdaq=0; AliSignal* daq=(AliSignal*)evt->GetDevice("Daq"); diff --git a/RALICE/icepack/IceChi2.cxx b/RALICE/icepack/IceChi2.cxx index 4e00483af9d..77f072c7e1d 100644 --- a/RALICE/icepack/IceChi2.cxx +++ b/RALICE/icepack/IceChi2.cxx @@ -19,6 +19,9 @@ // Class IceChi2 // TTask derived class to perform track fitting via chi-squared minimisation. // +// In case an event has been rejected by an AliEventSelector (based) processor, +// this task (and its sub-tasks) is not executed. +// // For the minimisation process the TFitter facility, which is basically Minuit, // is used. Minimisation is performed by invokation of the SIMPLEX method, // followed by an invokation of HESSE to determine the uncertainties on the results. @@ -221,6 +224,13 @@ void IceChi2::Exec(Option_t* opt) fEvt=(IceEvent*)parent->GetObject("IceEvent"); if (!fEvt) return; + // Only process accepted events + AliDevice* seldev=(AliDevice*)fEvt->GetDevice("AliEventSelector"); + if (seldev) + { + if (seldev->GetSignal("Select") < 0.1) return; + } + // Storage of the used parameters in the IceChi2 device AliSignal params; params.SetNameTitle("IceChi2","IceChi2 processor parameters"); diff --git a/RALICE/icepack/IceCleanHits.cxx b/RALICE/icepack/IceCleanHits.cxx index 292157acb42..36c902a1290 100644 --- a/RALICE/icepack/IceCleanHits.cxx +++ b/RALICE/icepack/IceCleanHits.cxx @@ -19,6 +19,9 @@ // Class IceCleanHits // TTask derived class to perform hit cleaning. // +// In case an event has been rejected by an AliEventSelector (based) processor, +// this task (and its sub-tasks) is not executed. +// // The code in this processor is based on the algorithms as developed // by Oladipo Fadiran and George Japaridze (Clark Atlanta University, USA). // @@ -244,6 +247,13 @@ void IceCleanHits::Exec(Option_t* opt) fEvt=(IceEvent*)parent->GetObject("IceEvent"); if (!fEvt) return; + // Only process accepted events + AliDevice* seldev=(AliDevice*)fEvt->GetDevice("AliEventSelector"); + if (seldev) + { + if (seldev->GetSignal("Select") < 0.1) return; + } + // Storage of the used parameters in the IceCleanHits device AliSignal params; params.SetNameTitle("IceCleanHits","IceCleanHits processor parameters"); diff --git a/RALICE/icepack/IceDwalk.cxx b/RALICE/icepack/IceDwalk.cxx index 340ef0b4a5f..296ce99f682 100644 --- a/RALICE/icepack/IceDwalk.cxx +++ b/RALICE/icepack/IceDwalk.cxx @@ -18,6 +18,10 @@ /////////////////////////////////////////////////////////////////////////// // Class IceDwalk // TTask derived class to perform direct walk track reconstruction. +// +// In case an event has been rejected by an AliEventSelector (based) processor, +// this task (and its sub-tasks) is not executed. +// // The procedure is based on the method described in the Amanda publication // in Nuclear Instruments and Methods A524 (2004) 179-180. // However, the Amanda method has been extended with the intention to @@ -466,6 +470,13 @@ void IceDwalk::Exec(Option_t* opt) fEvt=(IceEvent*)parent->GetObject("IceEvent"); if (!fEvt) return; + // Only process accepted events + AliDevice* seldev=(AliDevice*)fEvt->GetDevice("AliEventSelector"); + if (seldev) + { + if (seldev->GetSignal("Select") < 0.1) return; + } + // Enter the reco parameters as a device in the event AliSignal params; params.SetNameTitle(ClassName(),"Reco parameters"); diff --git a/RALICE/icepack/IceDwalkx.cxx b/RALICE/icepack/IceDwalkx.cxx index 50875df60b0..cc00ac38113 100644 --- a/RALICE/icepack/IceDwalkx.cxx +++ b/RALICE/icepack/IceDwalkx.cxx @@ -18,6 +18,10 @@ /////////////////////////////////////////////////////////////////////////// // Class IceDwalkx // TTask derived class to perform (Amanda-like) direct walk track reconstruction. +// +// In case an event has been rejected by an AliEventSelector (based) processor, +// this task (and its sub-tasks) is not executed. +// // This class is kept to provide a procedure that can closely match the // performance of the original Amanda direct walk-II algorithm as implemented // in the Sieglinde reconstruction framework. @@ -418,6 +422,13 @@ void IceDwalkx::Exec(Option_t* opt) IceEvent* evt=(IceEvent*)parent->GetObject("IceEvent"); if (!evt) return; + // Only process accepted events + AliDevice* seldev=(AliDevice*)evt->GetDevice("AliEventSelector"); + if (seldev) + { + if (seldev->GetSignal("Select") < 0.1) return; + } + // Enter the reco parameters as a device in the event AliSignal params; params.SetNameTitle("IceDwalkx","IceDwalkx reco parameters"); diff --git a/RALICE/icepack/IceLinefit.cxx b/RALICE/icepack/IceLinefit.cxx index f831b96f0f0..492f97846f2 100644 --- a/RALICE/icepack/IceLinefit.cxx +++ b/RALICE/icepack/IceLinefit.cxx @@ -18,6 +18,10 @@ /////////////////////////////////////////////////////////////////////////// // Class IceLinefit // TTask derived class to perform a linefit track reconstruction. +// +// In case an event has been rejected by an AliEventSelector (based) processor, +// this task (and its sub-tasks) is not executed. +// // The procedure is based on the method described in the Amanda publication // in Nuclear Instruments and Methods A524 (2004) 179-180. // To prevent waisting CPU time in trying to reconstruct (high-energy) cascade @@ -159,6 +163,13 @@ void IceLinefit::Exec(Option_t* opt) IceEvent* evt=(IceEvent*)parent->GetObject("IceEvent"); if (!evt) return; + // Only process accepted events + AliDevice* seldev=(AliDevice*)evt->GetDevice("AliEventSelector"); + if (seldev) + { + if (seldev->GetSignal("Select") < 0.1) return; + } + // Enter the reco parameters as a device in the event AliSignal params; params.SetNameTitle("IceLinefit","IceLinefit reco parameters"); diff --git a/RALICE/icepack/IceMakeHits.cxx b/RALICE/icepack/IceMakeHits.cxx index 09a00e7cc8e..cf0dcb01d7a 100644 --- a/RALICE/icepack/IceMakeHits.cxx +++ b/RALICE/icepack/IceMakeHits.cxx @@ -19,6 +19,9 @@ // Class IceMakeHits // TTask derived class to perform hit extraction from waveforms. // +// In case an event has been rejected by an AliEventSelector (based) processor, +// this task (and its sub-tasks) is not executed. +// // The code in this processor is based on the algorithms as developed by // Nick van Eijndhoven and Garmt de Vries-Uiterweerd (Utrecht University, The Netherlands). // @@ -150,6 +153,13 @@ void IceMakeHits::Exec(Option_t* opt) fEvt=(IceEvent*)parent->GetObject("IceEvent"); if (!fEvt) return; + // Only process accepted events + AliDevice* seldev=(AliDevice*)fEvt->GetDevice("AliEventSelector"); + if (seldev) + { + if (seldev->GetSignal("Select") < 0.1) return; + } + fDaq=(AliDevice*)fEvt->GetDevice("Daq"); if (!fDaq) return; diff --git a/RALICE/icepack/IcePandel.cxx b/RALICE/icepack/IcePandel.cxx index 5bca729485e..ff411276acd 100644 --- a/RALICE/icepack/IcePandel.cxx +++ b/RALICE/icepack/IcePandel.cxx @@ -20,6 +20,9 @@ // TTask derived class to perform track fitting via minimisation of a // convoluted Pandel pdf. // +// In case an event has been rejected by an AliEventSelector (based) processor, +// this task (and its sub-tasks) is not executed. +// // The code in this processor is based on the algorithms as developed // by Oladipo Fadiran, George Japaridze (Clark Atlanta University, USA) // and Nick van Eijndhoven (Utrecht University, The Netherlands). @@ -225,6 +228,13 @@ void IcePandel::Exec(Option_t* opt) fEvt=(IceEvent*)parent->GetObject("IceEvent"); if (!fEvt) return; + // Only process accepted events + AliDevice* seldev=(AliDevice*)fEvt->GetDevice("AliEventSelector"); + if (seldev) + { + if (seldev->GetSignal("Select") < 0.1) return; + } + // Storage of the used parameters in the IcePandel device AliSignal params; params.SetNameTitle("IcePandel","IcePandel processor parameters"); diff --git a/RALICE/icepack/IceXtalk.cxx b/RALICE/icepack/IceXtalk.cxx index 35159ef57ef..c393a20249d 100644 --- a/RALICE/icepack/IceXtalk.cxx +++ b/RALICE/icepack/IceXtalk.cxx @@ -19,6 +19,9 @@ // Class IceXtalk // TTask derived class to perform cross talk hit correction. // +// In case an event has been rejected by an AliEventSelector (based) processor, +// this task (and its sub-tasks) is not executed. +// // Note : This processor only acts on MuDaq data. // // This task takes the current event in memory and uses the attached @@ -144,6 +147,13 @@ void IceXtalk::Exec(Option_t* opt) IceEvent* evt=(IceEvent*)parent->GetObject("IceEvent"); if (!evt) return; + // Only process accepted events + AliDevice* seldev=(AliDevice*)evt->GetDevice("AliEventSelector"); + if (seldev) + { + if (seldev->GetSignal("Select") < 0.1) return; + } + Int_t mudaq=0; Int_t twrdaq=0; AliSignal* daq=(AliSignal*)evt->GetDevice("Daq"); diff --git a/RALICE/icepack/history.txt b/RALICE/icepack/history.txt index 1bddfc65668..ea1815cb01b 100644 --- a/RALICE/icepack/history.txt +++ b/RALICE/icepack/history.txt @@ -120,4 +120,7 @@ for more sophisticated reconstruction algorithms. Also expression for "ksi" corrected to correctly represent the traveled distance of the cherenkov photon in IcePandel.cxx. +27-sep-2007 NvE Check for event selection/rejection flag introduced in IceCalibrate.cxx, + IceChi2.cxx, IceCleanHits.cxx, IceDwalk.cxx, IceDwalkx.cxx, IceLinefit.cxx, + IceMakeHits.cxx, IcePandel.cxx and IceXtalk.cxx. diff --git a/RALICE/icepack/iceconvert/IceF2k.cxx b/RALICE/icepack/iceconvert/IceF2k.cxx index dfc4f9aab1c..614daafa5f9 100644 --- a/RALICE/icepack/iceconvert/IceF2k.cxx +++ b/RALICE/icepack/iceconvert/IceF2k.cxx @@ -26,6 +26,8 @@ // with the F2K data and before the final structures are written out. // Note that the data structures are only written out if an outputfile has // been specified via the SetOutputFile memberfunction. +// In case an AliEventSelector (based) task has been invoked, the data structures +// are only written out for events that fulfilled the selection criteria. // In case no outputfile has been specified, this class provides a facility // to investigate/analyse F2K data using the Ralice/IcePack analysis tools. // An indication of the active DAQ system is available in the IceEvent structure @@ -436,6 +438,7 @@ void IceF2k::Exec(Option_t* opt) daq.SetSignal(1,1); Int_t nevt=0; + Int_t evtsel=0; for (Int_t ifile=0; ifileAt(ifile); @@ -510,8 +513,14 @@ void IceF2k::Exec(Option_t* opt) if (!(nevt%fPrintfreq)) evt->HeaderData(); } - // Write the complete structure to the output Tree - if (otree) otree->Fill(); + // Write the complete structure to the output Tree for accepted events + evtsel=1; + AliDevice* seldev=(AliDevice*)evt->GetDevice("AliEventSelector"); + if (seldev) + { + if (seldev->GetSignal("Select") < 0.1) evtsel=-1; + } + if (otree && evtsel==1) otree->Fill(); // Update event counter nevt++; diff --git a/RALICE/icepack/iceconvert/IceRawTWR.cxx b/RALICE/icepack/iceconvert/IceRawTWR.cxx index 741a1a8be74..4b9241873d9 100644 --- a/RALICE/icepack/iceconvert/IceRawTWR.cxx +++ b/RALICE/icepack/iceconvert/IceRawTWR.cxx @@ -38,6 +38,8 @@ // with the raw TWR data and before the final structures are written out. // Note that the data structures are only written out if an outputfile has // been specified via the SetOutputFile memberfunction. +// In case an AliEventSelector (based) task has been invoked, the data structures +// are only written out for events that fulfilled the selection criteria. // In case no outputfile has been specified, this class provides a facility // to investigate/analyse raw TWR data using the Ralice/IcePack analysis tools. // @@ -284,6 +286,7 @@ void IceRawTWR::Exec(Option_t* opt) Int_t nevt=0; fHeader=0; + Int_t evtsel=0; for (Int_t ifile=0; ifileAt(ifile); @@ -393,8 +396,14 @@ void IceRawTWR::Exec(Option_t* opt) if (!(nevt%fPrintfreq)) evt->HeaderData(); } - // Write the complete structure to the output Tree - if (otree) otree->Fill(); + // Write the complete structure to the output Tree for accepted events + evtsel=1; + AliDevice* seldev=(AliDevice*)evt->GetDevice("AliEventSelector"); + if (seldev) + { + if (seldev->GetSignal("Select") < 0.1) evtsel=-1; + } + if (otree && evtsel==1) otree->Fill(); // Update event counter nevt++; diff --git a/RALICE/icepack/iceconvert/history.txt b/RALICE/icepack/iceconvert/history.txt index e1e1e233bff..eb1de360cca 100644 --- a/RALICE/icepack/iceconvert/history.txt +++ b/RALICE/icepack/iceconvert/history.txt @@ -133,4 +133,6 @@ of AliAttrib and AliSignal. Also all slots in IceCal2Root now created via the "AddSlotName" facility and slot access exclusively via the slotname, to enhance flexibility. +27-sep-2007 NvE Check for event selection flag introduced in IceF2k.cxx and IceRawTWR.cxx + to provide selected event output. diff --git a/RALICE/libRALICE.pkg b/RALICE/libRALICE.pkg index 9da5b1c4656..f79dcc45120 100644 --- a/RALICE/libRALICE.pkg +++ b/RALICE/libRALICE.pkg @@ -4,7 +4,7 @@ SRCS= Ali3Vector.cxx Ali4Vector.cxx AliBoost.cxx AliCalcluster.cxx \ AliTrack.cxx AliVertex.cxx Ali3VectorObj.cxx Ali4VectorObj.cxx \ AliPositionObj.cxx AliEvent.cxx AliCollider.cxx AliObjMatrix.cxx \ AliAttrib.cxx AliAttribObj.cxx AliHelix.cxx AliDevice.cxx \ - AliTimestamp.cxx AliJob.cxx AliAstrolab.cxx + AliTimestamp.cxx AliJob.cxx AliAstrolab.cxx AliEventSelector.cxx HDRS= $(SRCS:.cxx=.h) -- 2.43.0