shared library creation on AMD 64 (Athlon and Opteron) machines.
31-mar-2005 NvE AliObjMatrix derived from TNamed instead of from TObject to allow specification of
a name and title for this class.
13-apr-2005 NvE New memberfunctions SetFitDetails and GetFitDetails introduced in AliTrack
to enable a versatile facility to store details of various fit procedures
for a certain track. This new facility is based on the original idea of Adam Bouchta.
Destructor of AliSignal modified to remove the corresponding AliSignal instance
first from all related tracks before deleting the link matrix area.
Documentation of IceEvent updated w.r.t. the labeling of MC and Reco tracks.
14-apr-2005 NvE Functionality of ShowDevices extended in AliEvent. Also memberfunction HeaderData() modified
to prevent long output lists when many devices (and/or tracks) are present.
New memberfunction ShowTracks introduced in AliJet and memberfunction Data() updated.
18-apr-2005 NvE New memberfunction GetTracks introduced in AliJet to provide various track selections.
// Provide event header information
const char* name=GetName();
const char* title=GetTitle();
- Int_t ndevs=GetNdevices();
cout << " *" << ClassName() << "::Data*";
if (strlen(name)) cout << " Name : " << GetName();
if (strlen(title)) cout << " Title : " << GetTitle();
cout << endl;
Date(1);
- cout << " Run : " << fRun << " Event : " << fEvent
- << " Number of devices : " << ndevs << endl;
-
- if (ndevs) ShowDevices();
+ cout << " Run : " << fRun << " Event : " << fEvent << endl;
+ ShowDevices(0);
+ ShowTracks(0);
}
///////////////////////////////////////////////////////////////////////////
void AliEvent::Data(TString f)
return 0; // No matching id found
}
///////////////////////////////////////////////////////////////////////////
-void AliEvent::ShowDevices() const
+void AliEvent::ShowDevices(Int_t mode) const
{
// Provide an overview of the available devices.
+// The argument mode determines the amount of information as follows :
+// mode = 0 ==> Only printout of the number of devices
+// 1 ==> Provide a listing with 1 line of info for each device
+//
+// The default is mode=1.
+//
Int_t ndevs=GetNdevices();
if (ndevs)
{
- cout << " The following " << ndevs << " devices are available :" << endl;
- for (Int_t i=1; i<=ndevs; i++)
+ if (!mode)
{
- TObject* dev=GetDevice(i);
- if (dev)
+ cout << " There are " << ndevs << " devices available." << endl;
+ }
+ else
+ {
+ cout << " The following " << ndevs << " devices are available :" << endl;
+ for (Int_t i=1; i<=ndevs; i++)
{
- const char* name=dev->GetName();
- cout << " Device number : " << i;
- cout << " Class : " << dev->ClassName() << " Id : " << dev->GetUniqueID();
- if (strlen(name)) cout << " Name : " << name;
- if (dev->InheritsFrom("AliDevice")) cout << " Nhits : " << ((AliDevice*)dev)->GetNhits();
- cout << endl;
+ TObject* dev=GetDevice(i);
+ if (dev)
+ {
+ const char* name=dev->GetName();
+ cout << " Device number : " << i;
+ cout << " Class : " << dev->ClassName() << " Id : " << dev->GetUniqueID();
+ if (strlen(name)) cout << " Name : " << name;
+ if (dev->InheritsFrom("AliDevice")) cout << " Nhits : " << ((AliDevice*)dev)->GetNhits();
+ if (dev->InheritsFrom("AliSignal")) cout << " Nwaveforms : " << ((AliSignal*)dev)->GetNwaveforms();
+ cout << endl;
+ }
}
}
}
void SetDevCopy(Int_t j); // (De)activate creation of private copies of the devices
Int_t GetDevCopy() const; // Provide DevCopy flag value
void AddDevice(TObject& d); // Add a device to the event
- void AddDevice(TObject* d) { AddDevice(*d); }
+ void AddDevice(TObject* d) { if (d) AddDevice(*d); }
Int_t GetNdevices() const; // Provide the number of devices
- void ShowDevices() const; // Provide on overview of the available devices
+ void ShowDevices(Int_t mode=1) const; // Provide on overview of the available devices
TObject* GetDevice(Int_t i) const; // Provide i-th device of the event
TObject* GetDevice(TString name) const; // Provide the device with name "name"
TObject* GetIdDevice(Int_t id) const; // Provide the device with unique identifier "id"
TObjArray* fOrdered; //! Temp. array to hold references to various ordered objects
TObject* fDisplay; //! Temp. pointer to hold objects which serve event displays
- ClassDef(AliEvent,18) // Creation and investigation of an Alice physics event.
+ ClassDef(AliEvent,19) // Creation and investigation of an Alice physics event.
};
#endif
fTracks=0;
fNtinit=0;
fTrackCopy=0;
+ fSelected=0;
}
///////////////////////////////////////////////////////////////////////////
AliJet::AliJet(Int_t n) : TNamed(),Ali4Vector()
delete fTracks;
fTracks=0;
}
+ if (fSelected)
+ {
+ delete fSelected;
+ fSelected=0;
+ }
}
///////////////////////////////////////////////////////////////////////////
void AliJet::SetOwner(Bool_t own)
fTrackCopy=j.fTrackCopy;
fUserId=j.fUserId;
+ fSelected=0;
+
fTracks=0;
if (fNtrk)
{
if (strlen(title)) cout << " Title : " << GetTitle();
cout << endl;
cout << " Id : " << fUserId << " Invmass : " << GetInvmass() << " Charge : " << fQ
- << " Momentum : " << GetMomentum() << " Ntracks : " << fNtrk << endl;
+ << " Momentum : " << GetMomentum() << endl;
+
+ ShowTracks(0);
Ali4Vector::Data(f);
}
AliTrack* AliJet::GetTrack(Int_t i) const
{
// Return the i-th track of this jet
- if (!fTracks)
+
+ if (!fTracks) return 0;
+
+ if (i<=0 || i>fNtrk)
{
- cout << " *AliJet*::GetTrack* No tracks present." << endl;
+ cout << " *AliJet*::GetTrack* Invalid argument i : " << i
+ << " Ntrk = " << fNtrk << endl;
return 0;
}
else
{
- if (i<=0 || i>fNtrk)
- {
- cout << " *AliJet*::GetTrack* Invalid argument i : " << i
- << " Ntrk = " << fNtrk << endl;
- return 0;
- }
- else
- {
- return (AliTrack*)fTracks->At(i-1);
- }
+ return (AliTrack*)fTracks->At(i-1);
}
}
///////////////////////////////////////////////////////////////////////////
return 0; // No matching id found
}
///////////////////////////////////////////////////////////////////////////
+TObjArray* AliJet::GetTracks(Int_t idmode,Int_t chmode,Int_t pcode)
+{
+// Provide references to user selected tracks based on the idmode, chmode
+// and pcode selections as specified by the user.
+//
+// The following selection combinations are available :
+// ----------------------------------------------------
+// idmode = -1 ==> Select tracks with negative user identifier "id"
+// 0 ==> No selection on user identifier
+// 1 ==> Select tracks with positive user identifier "id"
+//
+// chmode = -1 ==> Select tracks with negative charge
+// 0 ==> Select neutral tracks
+// 1 ==> Select tracks with positive charge
+// 2 ==> No selection on charge
+//
+// pcode = 0 ==> No selection on particle code
+// X ==> Select tracks with particle code +X or -X
+// This allows selection of both particles and anti-particles
+// in case of PDG particle codes.
+// Selection of either particles or anti-particles can be
+// obtained in combination with the "chmode" selector.
+//
+// Examples :
+// ----------
+// idmode=-1 chmode=0 pcode=0 : Selection of all neutral tracks with negative id.
+// idmode=0 chmode=2 pcode=211 : Selection of all charged pions (PDG convention).
+// idmode=0 chmode=1 pcode=321 : Selection of all positive kaons (PDG convention).
+//
+// The default values are idmode=0 chmode=2 pcode=0 (i.e. no selections applied).
+//
+// Notes :
+// -------
+// 1) In case the user has labeled simulated tracks with negative id and
+// reconstructed tracks with positive id, this memberfunction provides
+// easy access to either all simulated or reconstructed tracks.
+// 2) Subsequent invokations of this memberfunction with e.g. chmode=-1 and chmode=1
+// provides a convenient way to investigate particle pairs with opposite charge
+// (e.g. for invariant mass analysis).
+
+ if (fSelected)
+ {
+ fSelected->Clear();
+ }
+ else
+ {
+ fSelected=new TObjArray();
+ }
+
+ if (!fTracks) return fSelected;
+
+ AliTrack* tx=0;
+ Int_t code=0;
+ Int_t id=0;
+ Float_t q=0;
+ for (Int_t i=0; i<fNtrk; i++)
+ {
+ tx=(AliTrack*)fTracks->At(i);
+ if (!tx) continue;
+
+ code=tx->GetParticleCode();
+ if (pcode && abs(pcode)!=abs(code)) continue;
+
+ id=tx->GetId();
+ if (idmode==-1 && id>=0) continue;
+ if (idmode==1 && id<=0) continue;
+
+ q=tx->GetCharge();
+ if (chmode==-1 && q>=0) continue;
+ if (chmode==0 && fabs(q)>1e-10) continue;
+ if (chmode==1 && q<=0) continue;
+
+ fSelected->Add(tx);
+ }
+
+ return fSelected;
+}
+///////////////////////////////////////////////////////////////////////////
+void AliJet::ShowTracks(Int_t mode) const
+{
+// Provide an overview of the available tracks.
+// The argument mode determines the amount of information as follows :
+// mode = 0 ==> Only printout of the number of tracks
+// 1 ==> Provide a listing with 1 line of info for each track
+//
+// The default is mode=1.
+//
+ Int_t ntk=GetNtracks();
+ if (ntk)
+ {
+ if (!mode)
+ {
+ cout << " There are " << ntk << " tracks available." << endl;
+ }
+ else
+ {
+ cout << " The following " << ntk << " tracks are available :" << endl;
+ for (Int_t i=1; i<=ntk; i++)
+ {
+ AliTrack* tx=GetTrack(i);
+ if (tx)
+ {
+ const char* name=tx->GetName();
+ const char* title=tx->GetTitle();
+ cout << " Track : " << i;
+ cout << " Id : " << tx->GetId();
+ cout << " Q : " << tx->GetCharge() << " m : " << tx->GetMass() << " p : " << tx->GetMomentum();
+ if (strlen(name)) cout << " Name : " << name;
+ if (strlen(title)) cout << " Title : " << title;
+ cout << endl;
+ }
+ }
+ }
+ }
+ else
+ {
+ cout << " No tracks are present." << endl;
+ }
+}
+///////////////////////////////////////////////////////////////////////////
Double_t AliJet::GetPt()
{
// Provide trans. momentum value w.r.t. z-axis.
Int_t GetNtracks() const; // Return the number of tracks in the jet
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
+ void ShowTracks(Int_t mode=1) const; // Provide on overview of the available tracks
Double_t GetPt(); // Provide trans. momentum w.r.t. z-axis
Double_t GetPl(); // Provide long. momentum w.r.t. z-axis
Double_t GetEt(); // Provide trans. energy w.r.t. z-axis
TObjArray* fTracks; // Array to hold the pointers to the tracks of the jet
Int_t fTrackCopy; // Flag to denote creation of private copies in fTracks
Int_t fUserId; // The user defined identifier
+ TObjArray* fSelected; //! Temp. array to hold user selected objects
- ClassDef(AliJet,9) // Creation and investigation of a jet of particle tracks.
+ ClassDef(AliJet,10) // Creation and investigation of a jet of particle tracks.
};
#endif
ClassImp(AliObjMatrix) // Class implementation to enable ROOT I/O
-AliObjMatrix::AliObjMatrix() : TObject()
+AliObjMatrix::AliObjMatrix() : TNamed()
{
// Default constructor.
// Note : The owner and swap mode flags will be initialised to 0.
// $Id$
-#include "TObject.h"
+#include "TNamed.h"
#include "TObjArray.h"
-#include "TRefArray.h"
#include "TArrayI.h"
-class AliObjMatrix : public TObject
+class AliObjMatrix : public TNamed
{
public:
AliObjMatrix(); // Default constructor
Int_t fMaxcol; // The maximum column number index
TObjArray* fObjects; // Linear reference array for fast looping over the stored objects
- ClassDef(AliObjMatrix,5) // Handling of a matrix structure of objects.
+ ClassDef(AliObjMatrix,6) // Handling of a matrix structure of objects.
};
#endif
}
if (fLinks)
{
+ // Remove this signal from all related tracks
+ for (Int_t i=1; i<=fLinks->GetNobjects(); i++)
+ {
+ TObject* obj=fLinks->GetObject(i);
+ if (!obj) continue;
+ if (obj->InheritsFrom("AliTrack"))
+ {
+ AliTrack* tx=(AliTrack*)obj;
+ tx->RemoveSignal(*this);
+ }
+ }
delete fLinks;
fLinks=0;
}
fImpactYZ=0;
fClosest=0;
fParent=0;
+ fFit=0;
}
///////////////////////////////////////////////////////////////////////////
AliTrack::~AliTrack()
delete fClosest;
fClosest=0;
}
+ if (fFit)
+ {
+ delete fFit;
+ fFit=0;
+ }
}
///////////////////////////////////////////////////////////////////////////
AliTrack::AliTrack(const AliTrack& t) : TNamed(t),Ali4Vector(t)
if (t.fImpactXZ) fImpactXZ=new AliPositionObj(*(t.fImpactXZ));
if (t.fImpactYZ) fImpactYZ=new AliPositionObj(*(t.fImpactYZ));
if (t.fClosest) fClosest=new AliPositionObj(*(t.fClosest));
+ if (t.fFit) fFit=t.fFit->Clone();
fUserId=t.fUserId;
fChi2=t.fChi2;
fNdf=t.fNdf;
delete fClosest;
fClosest=0;
}
+ if (fFit)
+ {
+ delete fFit;
+ fFit=0;
+ }
}
///////////////////////////////////////////////////////////////////////////
void AliTrack::Set3Momentum(Ali3Vector& p)
const char* title=GetTitle();
cout << " *" << ClassName() << "::Data*";
- if (strlen(name)) cout << " Name : " << GetName();
- if (strlen(title)) cout << " Title : " << GetTitle();
+ if (strlen(name)) cout << " Name : " << name;
+ if (strlen(title)) cout << " Title : " << title;
cout << endl;
cout << " Id : " << fUserId << " Code : " << fCode
<< " m : " << m << " dm : " << dm << " Charge : " << fQ
<< " p : " << GetMomentum() << endl;
cout << " Nhypotheses : " << GetNhypotheses() << " Ndecay-tracks : " << GetNdecay()
<< " Nsignals : " << GetNsignals() << endl;
+ if (fParent)
+ {
+ cout << " Parent track Id : " << fParent->GetId() << " Code : " << fParent->GetParticleCode()
+ << " m : " << fParent->GetMass() << " Q : " << fParent->GetCharge()
+ << " p : " << fParent->GetMomentum();
+ const char* pname=fParent->GetName();
+ const char* ptitle=fParent->GetTitle();
+ if (strlen(pname)) cout << " Name : " << pname;
+ if (strlen(ptitle)) cout << " Title : " << ptitle;
+ cout << endl;
+ }
+ if (fFit)
+ {
+ cout << " Fit details present in object of class " << fFit->ClassName() << endl;
+ if (fFit->InheritsFrom("AliSignal")) ((AliSignal*)fFit)->List(-1);
+ }
Ali4Vector::Data(f);
}
///////////////////////////////////////////////////////////////////////////
return fProb;
}
///////////////////////////////////////////////////////////////////////////
+void AliTrack::SetFitDetails(TObject* obj)
+{
+// Enter the object containing the fit details.
+// In case an object to hold fit details was already present, this
+// will be deleted first before the new one is stored.
+// This means that SetFitDetails(0) can be used to just remove the
+// existing object with the fit details.
+// All objects derived from TObject can be entered in this way.
+// Obvious candidates for objects containing detailed fit information
+// are functions (e.g. TF1) and histograms (e.g. TH1F).
+// However, using an AliDevice object provides a very versatile facility
+// to store the parameters of various fit procedures.
+// In such a case the AliDevice can be used to provide the various fit
+// definitions and the corresponding fit parameters can be entered as
+// separate AliSignal objects which are stored as hits to the AliDevice.
+// In addition various functions and histograms can be linked to the
+// various AliSignal instances
+// The latter procedure is based on the original idea of Adam Bouchta.
+//
+// Note : The entered object is owned by this AliTrack instance.
+// As such, a private copy of obj will be stored using the Clone()
+// memberfunction.
+// In case the entered object contains pointers to other objects,
+// the user has to provide the appropriate Clone() memberfunction
+// for the class to which the entered object belongs.
+// An example can be seen from AliTrack::Clone().
+//
+ if (fFit)
+ {
+ delete fFit;
+ fFit=0;
+ }
+
+ if (obj) fFit=obj->Clone();
+}
+///////////////////////////////////////////////////////////////////////////
+TObject* AliTrack::GetFitDetails()
+{
+// Provide the pointer to the object containing the fit details.
+ return fFit;
+}
+///////////////////////////////////////////////////////////////////////////
TObject* AliTrack::Clone(const char* name) const
{
// Make a deep copy of the current object and provide the pointer to the copy.
AliTrack* GetParentTrack(); // Provide pointer to the parent track
void SetProb(Double_t prob); // Set the hypothesis probability for this track
Float_t GetProb() const; // Provide the hypothesis probability for this track
+ void SetFitDetails(TObject* obj); // Enter the object containing the fit details
+ void SetFitDetails(TObject& obj) { SetFitDetails(&obj); }
+ TObject* GetFitDetails(); // Provide pointer to the object containing the fit details
protected:
Int_t fCode; // The user defined particle id code
AliTrack* fParent; // Pointer to the parent track
Float_t fProb; // Probability for this track as a hypothesis
+ TObject* fFit; // Object containing details of the fit
private:
void Dumps(AliTrack* t,Int_t n,TString f); // Recursively print all decay levels
- ClassDef(AliTrack,12) // Handling of the attributes of a reconstructed particle track.
+ ClassDef(AliTrack,13) // Handling of the attributes of a reconstructed particle track.
};
#endif
effort of eliminating the TTimeStamp restrictions.
04-mar-2005 NvE Installation scripts named amdgcclib.sh introduced in all /scripts directories to enable
shared library creation on AMD 64 (Athlon and Opteron) machines.
+31-mar-2005 NvE AliObjMatrix derived from TNamed instead of from TObject to allow specification of
+ a name and title for this class.
+13-apr-2005 NvE New memberfunctions SetFitDetails and GetFitDetails introduced in AliTrack
+ to enable a versatile facility to store details of various fit procedures
+ for a certain track. This new facility is based on the original idea of Adam Bouchta.
+ Destructor of AliSignal modified to remove the corresponding AliSignal instance
+ first from all related tracks before deleting the link matrix area.
+14-apr-2005 NvE Functionality of ShowDevices extended in AliEvent. Also memberfunction HeaderData() modified
+ to prevent long output lists when many devices (and/or tracks) are present.
+ New memberfunction ShowTracks introduced in AliJet and memberfunction Data() updated.
+18-apr-2005 NvE New memberfunction GetTracks introduced in AliJet to provide various track selections.
// Basically this class provides an IceCube tailored user interface
// to the functionality of the class AliEvent.
//
+// Notes :
+// ------
+// * In the event structure MC tracks are labeled with a negative track ID,
+// whereas reconstructed tracks are labeled with a positive track ID.
+// This allows for a direct selection of either MC or Reco tracks via the
+// GetIdTrack() facility.
+// * The particle codes used for the various tracks are the PDG ones.
+// For IceCube specific "particle" types (e.g. deltae) the PDG database
+// has been extended, as can be seen in the IceF2k class which provides
+// a conversion facility from the F2K into the Ralice/IcePack format.
+//
// Examples :
// ==========
//
01-dec-2004 NvE First release of the package as a subdirectory of Ralice.
18-feb-2005 NvE Copyright format modified in all .cxx source files in line with Ralice
such that the text shows up correctly in the auto-generated html docs.
+13-apr-2005 NvE Documentation of IceEvent updated w.r.t. the labeling of MC and Reco tracks.