#include "AliPHOSAnalyze.h"
#include "AliPHOSClusterizerv1.h"
#include "AliPHOSTrackSegmentMakerv1.h"
-#include "AliPHOSParticleGuesserv1.h"
+#include "AliPHOSPIDv1.h"
#include "AliPHOSReconstructioner.h"
#include "AliPHOSDigit.h"
#include "AliPHOSTrackSegment.h"
delete fClu ;
fClu = 0 ;
- delete fPag ;
- fPag = 0 ;
+ delete fPID ;
+ fPID = 0 ;
delete fRec ;
fRec = 0 ;
fClu->SetCalibrationParameters(0., 0.00000001) ;
//========== Creates the track segment maker
fTrs = new AliPHOSTrackSegmentMakerv1() ;
- //========== Creates the particle guesser
- fPag = new AliPHOSParticleGuesserv1() ;
+ //========== Creates the particle identifier
+ fPID = new AliPHOSPIDv1() ;
//========== Creates the Reconstructioner
- fRec = new AliPHOSReconstructioner(fClu, fTrs, fPag) ;
+ fRec = new AliPHOSReconstructioner(fClu, fTrs, fPID) ;
//========== Event Number
if ( ( log10(ievent+1) - (Int_t)(log10(ievent+1)) ) == 0. ) cout << "AnalyzeManyEvents > " << "Event is " << ievent << endl ;
//=========== Connects the various Tree's for evt
}
}
}
- // Deleting fClu, fTrs, fPag et fRec
+ // Deleting fClu, fTrs, fPID et fRec
fClu->Delete();
fTrs->Delete();
- fPag->Delete();
+ fPID->Delete();
fRec->Delete();
} // endfor
fTrs = new AliPHOSTrackSegmentMakerv1() ;
cout << "AnalyzeOneEvent > using tack segment maker " << fTrs->GetName() << endl ;
- //========== Creates the particle guesser
+ //========== Creates the particle identifier
- fPag = new AliPHOSParticleGuesserv1() ;
- cout << "AnalyzeOneEvent > using particle guess " << fPag->GetName() << endl ;
+ fPID = new AliPHOSPIDv1() ;
+ cout << "AnalyzeOneEvent > using particle identifier " << fPID->GetName() << endl ;
//========== Creates the Reconstructioner
- fRec = new AliPHOSReconstructioner(fClu, fTrs, fPag) ;
+ fRec = new AliPHOSReconstructioner(fClu, fTrs, fPID) ;
//=========== Connect the various Tree's for evt
fGeom->AbsToRelNumbering(digit->GetId(), relid) ;
if (relid[0] == module)
{
-
-Int_t nprim = digit->GetNprimary() ;
- cout << " digit nprim = " << nprim << endl ;
-Int_t ii ;
-Int_t * aprim = digit->GetPrimary() ;
-for ( ii = 0 ; ii < nprim ; ii++)
- cout << ii << " prim = " << aprim[ii] << endl ;
-
nDigits++ ;
energy = fClu->Calibrate(digit->GetAmp()) ;
etot += energy ;
AliPHOSEmcRecPoint * emc ;
while((emc = (AliPHOSEmcRecPoint *)nextemc()))
{
-
Int_t numberofprimaries ;
Int_t * primariesarray = new Int_t[10] ;
emc->GetPrimaries(numberofprimaries, primariesarray) ;
- // cout << " HELLO " << numberofprimaries << endl ;
- // Int_t index ;
- //for ( index = 0 ; index < numberofprimaries ; index++)
- // cout << index << " " << primariesarray[index] << endl;
-
totalnClusters++ ;
if ( emc->GetPHOSMod() == module )
{
nClusters++ ;
energy = emc->GetTotalEnergy() ;
etot+= energy ;
- emc->Draw("P") ;
+ emc->Draw("M") ;
}
}
cout << "DrawRecPoints > Found " << totalnClusters << " EMC Clusters in PHOS" << endl ;
#include "AliPHOSv0.h"
#include "AliPHOSGeometry.h"
+#include "AliPHOSPID.h"
class AliPHOSAnalyze : public TObject {
Int_t fEvt ; // the evt number being processed
AliPHOSGeometry * fGeom; // the PHOS Geometry object
AliPHOSv0 * fPHOS ; // the PHOS object from the root file
- AliPHOSParticleGuesser * fPag ; // a particle guesser
+ AliPHOSPID * fPID ; // a particle identifier
AliPHOSReconstructioner * fRec ; // a reconstructioner
TFile * fRootFile ; // the root file that contains the data
AliPHOSTrackSegmentMaker * fTrs ; // a tracksegmentmaker ;
//____________________________________________________________________________
AliPHOSDigit::AliPHOSDigit() : fPrimary(0)
{
+ fNprimary = 0 ;
+ Int_t index ;
+ for (index = 1 ; index <= 3 ; index++)
+ SetPrimary(index, 0) ;
}
//____________________________________________________________________________
fPrimary = new Int_t[1] ;
fPrimary[0] = primary ;
fNprimary = 1 ;
+ SetPrimary(1, primary) ;
+
}
//____________________________________________________________________________
fPrimary = new Int_t[fNprimary] ;
Int_t * primary = digit.GetPrimary() ;
Int_t index ;
- for ( index = 0 ; index < fNprimary ; index++ )
+ for ( index = 0 ; index < fNprimary ; index++ ) {
fPrimary[index] = primary[index] ;
+ SetPrimary( index+1, digit.GetPrimary(index+1) ) ;
+ }
+
}
//____________________________________________________________________________
AliPHOSDigit::~AliPHOSDigit()
{
- delete fPrimary ;
+ if ( fPrimary != 0 )
+ delete fPrimary ;
}
//____________________________________________________________________________
return rv ;
}
+
+//____________________________________________________________________________
+Int_t AliPHOSDigit::GetPrimary(Int_t index) const
+{
+ Int_t rv = -1 ;
+ if ( index > 3 )
+ cout << "AliPHOSDigit ERROR > only 3 primaries allowed" << endl ;
+ else {
+ switch (index) {
+ case 1 :
+ rv = fPrimary1 ;
+ break ;
+ case 2 :
+ rv = fPrimary2 ;
+ break ;
+ case 3 :
+ rv = fPrimary3 ;
+ break ;
+ }
+ }
+
+ return rv ;
+
+}
+
//____________________________________________________________________________
Bool_t AliPHOSDigit::operator==(AliPHOSDigit const & digit) const
{
fPrimary[index] = digit.fPrimary[jndex] ;
jndex++ ;
}
-
+
+ // Here comes something crummy ... but I do not know how to stream pointers
+ // because AliPHOSDigit is in a TCLonesArray
+
+ if ( fNprimary > 3 )
+ cout << "AliPHOSDigit + operator ERROR > too many primaries, modify AliPHOSDigit" << endl ;
+ else {
+ switch (fNprimary) {
+ case 1 :
+ SetPrimary(1, fPrimary[0]) ;
+ break ;
+ case 2 :
+ SetPrimary(2, fPrimary[1]) ;
+ break ;
+ case 3:
+ SetPrimary(3, fPrimary[2]) ;
+ break ;
+ }
+ }
+
+ // end of crummy stuff
+
return *this ;
}
return out ;
}
-//______________________________________________________________________________
-void AliPHOSDigit::Streamer(TBuffer &R__b)
+//____________________________________________________________________________
+void AliPHOSDigit::SetPrimary(Int_t index, Int_t value)
{
- assert(0==1) ;
- // Stream an object of class AliPHOSDigit.
- if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- AliDigitNew::Streamer(R__b);
- R__b.ReadArray(fPrimary);
- R__b >> fNprimary;
- } else {
- R__b.WriteVersion(AliPHOSDigit::IsA());
- AliDigitNew::Streamer(R__b);
- R__b.WriteArray(fPrimary, fNprimary);
- R__b << fNprimary;
-
- }
-}
+ switch (index) {
+ case 1 :
+ fPrimary1 = value ;
+ break ;
+ case 2 :
+ fPrimary2 = value ;
+ break ;
+ case 3 :
+ fPrimary3 = value ;
+ break ;
+ }
-
+ }
Int_t Compare(TObject * obj) ;
Int_t GetNprimary() const { return fNprimary ; }
Int_t * GetPrimary() const { return fPrimary ; }
+ Int_t GetPrimary(Int_t index) const ;
Bool_t IsSortable() const { return kTRUE ; }
void SetAmp(Int_t Amp) { fAmp=Amp ; }
-
+ void SetPrimary(Int_t index, Int_t value) ;
+
private:
- Int_t * fPrimary ; // Array of primary particles which contribute to the digit
+ Int_t * fPrimary ; //! Array of primary particles which contribute to the digit
+ Int_t fPrimary1 ; // first primary (because I do not know how to stream *fPrimary)
+ Int_t fPrimary2 ; // second primary (because I do not know how to stream *fPrimary)
+ Int_t fPrimary3 ; // third primary (because I do not know how to stream *fPrimary)
Int_t fNprimary ; // Number of primaries
ClassDef(AliPHOSDigit,1) // Digit in PHOS, version 1
**************************************************************************/
//_________________________________________________________________________
-// To guess the type of particle detected in PHOS with or without the help
+// To identify the type of particle detected in PHOS with or without the help
// from other detectors
//*-- Author : Yves Schutz SUBATECH
//////////////////////////////////////////////////////////////////////////////
// --- AliRoot header files ---
-#include "AliPHOSParticleGuesser.h"
+#include "AliPHOSPID.h"
-ClassImp(AliPHOSParticleGuesser)
+ClassImp(AliPHOSPID)
//____________________________________________________________________________
-AliPHOSParticleGuesser::AliPHOSParticleGuesser()
+AliPHOSPID::AliPHOSPID()
{
// ctor
}
//____________________________________________________________________________
-AliPHOSParticleGuesser::~AliPHOSParticleGuesser()
+AliPHOSPID::~AliPHOSPID()
{
// dtor
}
-#ifndef ALIPHOSPARTICLEGUESSER_H
-#define ALIPHOSPARTICLEGUESSER_H
+#ifndef ALIPHOSPID_H
+#define ALIPHOSPID_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
////////////////////////////////////////////////
-// Algorithme class for the guess of //
+// Algorithme class for the identification of//
// particles detected in PHOS //
-// interface class //
+// base class //
// Version SUBATECH //
// Author Yves Schutz SUBATECH //
// //
typedef TClonesArray RecParticlesList ;
-class AliPHOSParticleGuesser : public TObject {
+class AliPHOSPID : public TObject {
public:
- AliPHOSParticleGuesser() ; // ctor
- virtual ~AliPHOSParticleGuesser() ; // dtor
+ AliPHOSPID() ; // ctor
+ virtual ~AliPHOSPID() ; // dtor
virtual void GuessParticleType(TrackSegmentsList * trsl, RecParticlesList * rpl) {} ;
- ClassDef(AliPHOSParticleGuesser,1) // Particle Guesser interface, version 1
+ ClassDef(AliPHOSPID,1) // Particle Guesser interface, version 1
} ;
-#endif // ALIPHOSPARTICLEGUESSER_H
+#endif // ALIPHOSPID_H
**************************************************************************/
//_________________________________________________________________________
-// Algorithm class to guess the type of particle from the PHOS TrackSegment alone
+// Algorithm class to identify the type of particle from the PHOS TrackSegment alone
//*-- Author : Y. Schutz SUBATECH
//////////////////////////////////////////////////////////////////////////////
// --- AliRoot header files ---
-#include "AliPHOSParticleGuesserv1.h"
+#include "AliPHOSPIDv1.h"
#include "AliPHOSTrackSegment.h"
#include "AliPHOSRecParticle.h"
-ClassImp( AliPHOSParticleGuesserv1)
+ClassImp( AliPHOSPIDv1)
//____________________________________________________________________________
- AliPHOSParticleGuesserv1::AliPHOSParticleGuesserv1()
+ AliPHOSPIDv1::AliPHOSPIDv1()
{
// ctor
}
//____________________________________________________________________________
- AliPHOSParticleGuesserv1::~AliPHOSParticleGuesserv1()
+ AliPHOSPIDv1::~AliPHOSPIDv1()
{
// dtor
}
//____________________________________________________________________________
-void AliPHOSParticleGuesserv1::GuessParticleType(TrackSegmentsList * trsl, RecParticlesList * rpl)
+void AliPHOSPIDv1::GetParticleType(TrackSegmentsList * trsl, RecParticlesList * rpl)
{
// main function, does the job
-#ifndef ALIPHOSPARTICLEGUESSERV1_H
-#define ALIPHOSPARTICLEGUESSERV1_H
+#ifndef ALIPHOSPIDV1_H
+#define ALIPHOSPIDV1_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
///////////////////////////////////////////////////
-// Particle Guesser class for PHOS //
+// Particle Identifier class for PHOS //
// Version SUBATECH //
// Author Yves Schutz //
// comment: guess the type of particle //
// --- AliRoot header files ---
-#include "AliPHOSParticleGuesser.h"
+#include "AliPHOSPID.h"
-class AliPHOSParticleGuesserv1 : public AliPHOSParticleGuesser {
+class AliPHOSPIDv1 : public AliPHOSPID {
public:
- AliPHOSParticleGuesserv1() ;
- virtual ~ AliPHOSParticleGuesserv1() ; // dtor
+ AliPHOSPIDv1() ;
+ virtual ~ AliPHOSPIDv1() ; // dtor
- void GuessParticleType(TrackSegmentsList * trsl, RecParticlesList * rpl ) ; // does the job
+ void GetParticleType(TrackSegmentsList * trsl, RecParticlesList * rpl ) ; // does the job
- ClassDef( AliPHOSParticleGuesserv1,1) // particle guesser implementation , version 1
+ ClassDef( AliPHOSPIDv1,1) // particle identifier implementation , version 1
};
-#endif // AliPHOSPARTICLEGUESSERV1_H
+#endif // AliPHOSPIDV1_H
private:
AliPHOSTrackSegment * fPHOSTrackSegment ; // pointer to the associated track segment in PHOS
- Int_t fType ; // guessed particle type
+ Int_t fType ; // identified particle type
ClassDef(AliPHOSRecParticle,1) // Reconstructed Particle, version 1
{
AliPHOSDigit * digit ;
Int_t index ;
- Int_t maxcounter = 10 ;
+ Int_t maxcounter = 3 ;
Int_t counter = 0 ;
Int_t * tempo = new Int_t[maxcounter] ;
for ( index = 0 ; index < GetDigitsMultiplicity() ; index++ ) { // all digits
digit = (AliPHOSDigit *) fDigitsList[index] ;
- Int_t * newprimaryarray = digit->GetPrimary() ;
Int_t nprimaries = digit->GetNprimary() ;
- // cout << " nprimaries = " << nprimaries << endl ;
+ Int_t * newprimaryarray = new Int_t[nprimaries] ;
+ Int_t ii ;
+ for ( ii = 0 ; ii < nprimaries ; ii++)
+ newprimaryarray[ii] = digit->GetPrimary(ii+1) ;
Int_t jndex ;
for ( jndex = 0 ; jndex < nprimaries ; jndex++ ) { // all primaries in digit
- if ( counter >= maxcounter ) {
+ if ( counter > maxcounter ) {
number = - 1 ;
cout << "AliPHOSRecPoint::GetNprimaries ERROR > increase maxcounter " << endl ;
break ;
}
Int_t newprimary = newprimaryarray[jndex] ;
- // cout << "GetPrimaries " << newprimary << endl ;
Int_t kndex ;
Bool_t already = kFALSE ;
for ( kndex = 0 ; kndex < counter ; kndex++ ) { //check if not already stored
counter++ ;
} // store it
} // all primaries in digit
+ delete newprimaryarray ;
} // all digits
- counter-- ;
number = counter ;
for ( index = 0 ; index < number ; index ++ )
list[index] = tempo[index] ;
-
+
+ delete tempo ;
}
//______________________________________________________________________________
// //
// Author Gines MARTINEZ SUBATECH //
// //
-// january 2000: added Particle guesser (YS) //
+// january 2000: //
+// added Particle identifier (YS) //
// //
// //
////////////////////////////////////////////////
#include "TObject.h"
#include "AliPHOSClusterizer.h"
#include "AliPHOSTrackSegmentMaker.h"
-#include "AliPHOSParticleGuesser.h"
+#include "AliPHOSPID.h"
#include "TClonesArray.h"
// --- Standard library ---
AliPHOSReconstructioner(); //ctor
AliPHOSReconstructioner(AliPHOSClusterizer * Clusterizer, AliPHOSTrackSegmentMaker * Tracker,
- AliPHOSParticleGuesser * Guesser); //ctor
+ AliPHOSPID * Identifier); //ctor
~AliPHOSReconstructioner(); // dtor
AliPHOSClusterizer * GetClusterizer() { return fClusterizer ; }
void Init(AliPHOSClusterizer * Clusterizer, AliPHOSTrackSegmentMaker * Tracker,
- AliPHOSParticleGuesser * Guesser) ;
+ AliPHOSPID * Identifier) ;
void Make(TClonesArray * DL, RecPointsList * emccl, RecPointsList * ppsdl,
TrackSegmentsList * trsl, RecParticlesList * rpl) ; // does the job
AliPHOSClusterizer * fClusterizer ; // Method for clusterization
AliPHOSTrackSegmentMaker * fTrackSegmentMaker ; // Method for track segments finding
- AliPHOSParticleGuesser * fParticleGuesser ; // Method for guessing the type of particle
+ AliPHOSPID * fPID ; // Method for identifying the type of particle
ClassDef(AliPHOSReconstructioner,1) // Reconstruction interface , version 1
//___________________________________________________________________________
void AliPHOSv0::FinishEvent()
{
- cout << "//_____________________________________________________" << endl ;
- cout << "<I> AliPHOSv0::FinishEvent() -- Starting digitalization" << endl ;
+// cout << "//_____________________________________________________" << endl ;
+// cout << "<I> AliPHOSv0::FinishEvent() -- Starting digitalization" << endl ;
Int_t i ;
Int_t relid[4];
Int_t j ;
}
// Noise induced by the PIN diode of the PbWO crystals
+
Float_t energyandnoise ;
for ( i = 0 ; i < fNdigits ; i++ ) {
newdigit = (AliPHOSDigit * ) fDigits->At(i) ;
-
-// int nprim = newdigit->GetNprimary() ;
-// cout << " finishevent " << nprim << endl ;
-// int * prim = newdigit->GetPrimary() ;
-// for (int ii = 0 ; ii < nprim ; ii++)
-// cout << ii << " prim = " << prim[ii] << endl ;
-
fGeom->AbsToRelNumbering(newdigit->GetId(), relid) ;
if (relid[1]==0){ // Digits belong to EMC (PbW0_4 crystals)
energyandnoise = newdigit->GetAmp() + Digitize(gRandom->Gaus(0., fPINElectronicNoise)) ;
}
}
-
- // Reset the array of all the "accumulated hits" of this event.
fNTmpHits = 0 ;
fTmpHits->Delete();
}
if (fDigits && gAlice->TreeD() && cd) {
gAlice->TreeD()->Branch(branchname,&fDigits, fBufferSize);
- printf("* AliPHOS::MakeBranch * Making Branch %s for digits\n",branchname);
+ // printf("* AliPHOS::MakeBranch * Making Branch %s for digits\n",branchname);
}
}
AliPHOSClusterizer.cxx AliPHOSClusterizerv1.cxx AliPHOSLink.cxx \
AliPHOSReconstructioner.cxx AliPHOSTrackSegment.cxx \
AliPHOSTrackSegmentMaker.cxx AliPHOSTrackSegmentMakerv1.cxx \
- AliPHOSRecParticle.cxx AliPHOSParticleGuesser.cxx AliPHOSParticleGuesserv1.cxx \
+ AliPHOSRecParticle.cxx AliPHOSPID.cxx AliPHOSPIDv1.cxx \
AliPHOSAnalyze.cxx
#include "AliPHOSReconstructioner.h"
#include "AliPHOSTrackSegment.h"
#include "AliPHOSTrackSegmentMakerv1.h"
-#include "AliPHOSParticleGuesserv1.h"
+#include "AliPHOSPIDv1.h"
#include "PHOSHistos.h"
AliPHOSGeometry * Geom = AliPHOSGeometry::GetInstance(PHOS->GetGeometry()->GetName(),PHOS->GetGeometry()->GetTitle());
//========== Creates the track segment maker
AliPHOSTrackSegmentMakerv1 * tracksegmentmaker = new AliPHOSTrackSegmentMakerv1() ;
- //========== Creates the particle guesser
- AliPHOSParticleGuesserv1 * particleguesser = new AliPHOSParticleGuesserv1 ;
- cout << "AnalyzeOneEvent > using particle guess " << particleguesser->GetName() << endl ;
+ //========== Creates the particle identifier
+ AliPHOSPIDv1 * particleidentifier = new AliPHOSPIDv1 ;
+ cout << "AnalyzeOneEvent > using particle guess " << particleidentifier->GetName() << endl ;
TH1F * hEmcDigit = new TH1F("hEmcDigit","hEmcDigit",1000,0.,5.);
TH1F * hVetoDigit = new TH1F("hVetoDigit","hVetoDigit",1000,0.,3.e-5);
clusterizer->SetCalibrationParameters(0., 0.00000001) ;
//========== Creates the Reconstructioner
- AliPHOSReconstructioner * Reconstructioner = new AliPHOSReconstructioner(clusterizer, tracksegmentmaker, particleguesser) ;
+ AliPHOSReconstructioner * Reconstructioner = new AliPHOSReconstructioner(clusterizer, tracksegmentmaker, particleidentifier) ;
cout << "Event " << ievent <<endl;
#pragma link C++ class AliPHOS ;
#pragma link C++ class AliPHOSClusterizer ;
#pragma link C++ class AliPHOSClusterizerv1 ;
-#pragma link C++ class AliPHOSDigit- ;
+#pragma link C++ class AliPHOSDigit ;
#pragma link C++ class AliPHOSEmcRecPoint- ;
#pragma link C++ class AliPHOSGeometry ;
#pragma link C++ class AliPHOSHit ;
#pragma link C++ class AliPHOSTrackSegmentMaker ;
#pragma link C++ class AliPHOSTrackSegmentMakerv1 ;
#pragma link C++ class AliPHOSRecParticle ;
-#pragma link C++ class AliPHOSParticleGuesser ;
-#pragma link C++ class AliPHOSParticleGuesserv1 ;
+#pragma link C++ class AliPHOSPID ;
+#pragma link C++ class AliPHOSPIDv1 ;
#pragma link C++ class AliPHOSAnalyze ;
#endif