// This TTask is normally called from Reconstructioner, but can as well be used in
// standalone mode.
// Use Case:
-// root [0] AliPHOSClusterizerv1 * cl = new AliPHOSClusterizerv1("galice.root")
+// root [0] AliPHOSClusterizerv1 * cl = new AliPHOSClusterizerv1("galice.root", "recpointsname", "digitsname")
// Warning in <TDatabasePDG::TDatabasePDG>: object already instantiated
-// //reads gAlice from header file "..."
+// // reads gAlice from header file "galice.root", uses digits stored in the branch names "digitsname" (default = "Default")
+// // and saves recpoints in branch named "recpointsname" (default = "digitsname")
// root [1] cl->ExecuteTask()
// //finds RecPoints in all events stored in galice.root
// root [2] cl->SetDigitsBranch("digits2")
fHeaderFileName = "" ;
fDigitsBranchTitle = "" ;
+ fFrom = "" ;
+
fRecPointsInRun = 0 ;
}
//____________________________________________________________________________
-AliPHOSClusterizerv1::AliPHOSClusterizerv1(const char* headerFile,const char* name)
+AliPHOSClusterizerv1::AliPHOSClusterizerv1(const char* headerFile,const char* name, const char * from)
:AliPHOSClusterizer(headerFile, name)
{
// ctor with the indication of the file where header Tree and digits Tree are stored
clusterizerName.Append(Version()) ;
SetName(clusterizerName) ;
fRecPointsInRun = 0 ;
-
+ if ( from == 0 )
+ fFrom = name ;
+ else
+ fFrom = from ;
Init() ;
}
+
//____________________________________________________________________________
AliPHOSClusterizerv1::~AliPHOSClusterizerv1()
{
}
+
+//____________________________________________________________________________
+const TString AliPHOSClusterizerv1::BranchName() const
+{
+ TString branchName(GetName() ) ;
+ branchName.Remove(branchName.Index(Version())-1) ;
+ return branchName ;
+}
+
//____________________________________________________________________________
Float_t AliPHOSClusterizerv1::Calibrate(Int_t amp, Int_t absId) const
{
MakeClusters() ;
- if(fToUnfold) MakeUnfolding() ;
+ if(fToUnfold)
+ MakeUnfolding() ;
WriteRecPoints(ievent) ;
PrintRecPoints(option) ;
//increment the total number of digits per run
- fRecPointsInRun += gime->EmcRecPoints()->GetEntriesFast() ;
- fRecPointsInRun += gime->CpvRecPoints()->GetEntriesFast() ;
+ fRecPointsInRun += gime->EmcRecPoints(BranchName())->GetEntriesFast() ;
+ fRecPointsInRun += gime->CpvRecPoints(BranchName())->GetEntriesFast() ;
}
if(strstr(option,"tim")){
// Cluster will be fitted as a superposition of nPar/3 electromagnetic showers
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
- TClonesArray * digits = gime->Digits() ;
+ TClonesArray * digits = gime->Digits(fFrom) ;
gMinuit->mncler(); // Reset Minuit's list of paramters
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
TString branchname = GetName() ;
branchname.Remove(branchname.Index(Version())-1) ;
- AliPHOSDigitizer * dig = gime->Digitizer(branchname) ;
+ AliPHOSDigitizer * dig = gime->Digitizer(fFrom) ;
fADCchanelEmc = dig->GetEMCchannel() ;
fADCpedestalEmc = dig->GetEMCpedestal();
TString branchname = GetName() ;
branchname.Remove(branchname.Index(Version())-1) ;
- AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), branchname) ;
+ AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), fFrom.Data()) ;
if ( gime == 0 ) {
cerr << "ERROR: AliPHOSClusterizerv1::Init -> Could not obtain the Getter object !" << endl ;
return ;
gime->PostClusterizer(this) ;
// create a folder on the white board //YSAlice/WhiteBoard/RecPoints/PHOS/recpointsName
- gime->PostRecPoints(branchname ) ;
+ gime->PostRecPoints(branchname) ;
- gime->PostDigits(branchname) ;
- gime->PostDigitizer(branchname) ;
+ gime->PostDigits(fFrom) ;
+ gime->PostDigitizer(fFrom) ;
}
// Creates new branches with given title
// fills and writes into TreeR.
- TString branchName(GetName() ) ;
- branchName.Remove(branchName.Index(Version())-1) ;
AliPHOSGetter *gime = AliPHOSGetter::GetInstance() ;
- TObjArray * emcRecPoints = gime->EmcRecPoints(branchName) ;
- TObjArray * cpvRecPoints = gime->CpvRecPoints(branchName) ;
- TClonesArray * digits = gime->Digits(branchName) ;
+ TObjArray * emcRecPoints = gime->EmcRecPoints(BranchName()) ;
+ TObjArray * cpvRecPoints = gime->CpvRecPoints(BranchName()) ;
+ TClonesArray * digits = gime->Digits(fFrom) ;
Int_t index ;
//Evaluate position, dispersion and other RecPoint properties...
((AliPHOSEmcRecPoint *)emcRecPoints->At(index))->EvalAll(fW0,digits) ;
emcRecPoints->Sort() ;
-
for(index = 0; index < emcRecPoints->GetEntries(); index++)
((AliPHOSEmcRecPoint *)emcRecPoints->At(index))->SetIndexInList(index) ;
//First EMC
TBranch * emcBranch = gAlice->TreeR()->Branch("PHOSEmcRP","TObjArray",&emcRecPoints,bufferSize,splitlevel);
- emcBranch->SetTitle(branchName);
+ emcBranch->SetTitle(BranchName());
if (filename) {
emcBranch->SetFile(filename);
TIter next( emcBranch->GetListOfBranches());
//Now CPV branch
TBranch * cpvBranch = gAlice->TreeR()->Branch("PHOSCpvRP","TObjArray",&cpvRecPoints,bufferSize,splitlevel);
- cpvBranch->SetTitle(branchName);
+ cpvBranch->SetTitle(BranchName());
if (filename) {
cpvBranch->SetFile(filename);
TIter next( cpvBranch->GetListOfBranches());
}
//And Finally clusterizer branch
- AliPHOSClusterizerv1 * cl = (AliPHOSClusterizerv1*)gime->Clusterizer(branchName) ;
+ AliPHOSClusterizerv1 * cl = (AliPHOSClusterizerv1*)gime->Clusterizer(BranchName()) ;
TBranch * clusterizerBranch = gAlice->TreeR()->Branch("AliPHOSClusterizer","AliPHOSClusterizerv1",
&cl,bufferSize,splitlevel);
- clusterizerBranch->SetTitle(branchName);
+ clusterizerBranch->SetTitle(BranchName());
if (filename) {
clusterizerBranch->SetFile(filename);
TIter next( clusterizerBranch->GetListOfBranches());
{
// Steering method to construct the clusters stored in a list of Reconstructed Points
// A cluster is defined as a list of neighbour digits
- TString branchName(GetName()) ;
- branchName.Remove(branchName.Index(Version())-1) ;
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
- TObjArray * emcRecPoints = gime->EmcRecPoints(branchName) ;
- TObjArray * cpvRecPoints = gime->CpvRecPoints(branchName) ;
+ TObjArray * emcRecPoints = gime->EmcRecPoints(BranchName()) ;
+ TObjArray * cpvRecPoints = gime->CpvRecPoints(BranchName()) ;
emcRecPoints->Delete() ;
cpvRecPoints->Delete() ;
- TClonesArray * digits = gime->Digits(branchName) ;
+ TClonesArray * digits = gime->Digits(fFrom) ;
+ if ( !digits ) {
+ cerr << "ERROR: AliPHOSClusterizerv1::MakeClusters -> Digits with name "
+ << fFrom << " not found ! " << endl ;
+ abort() ;
+ }
TClonesArray * digitsC = (TClonesArray*)digits->Clone() ;
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
+
const AliPHOSGeometry * geom = gime->PHOSGeometry() ;
- TObjArray * emcRecPoints = gime->EmcRecPoints() ;
- TObjArray * cpvRecPoints = gime->CpvRecPoints() ;
- TClonesArray * digits = gime->Digits() ;
+ TObjArray * emcRecPoints = gime->EmcRecPoints(BranchName()) ;
+ TObjArray * cpvRecPoints = gime->CpvRecPoints(BranchName()) ;
+ TClonesArray * digits = gime->Digits(fFrom) ;
// Unfold first EMC clusters
if(fNumberOfEmcClusters > 0){
// Performs the unfolding of a cluster with nMax overlapping showers
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
+
const AliPHOSGeometry * geom = gime->PHOSGeometry() ;
- const TClonesArray * digits = gime->Digits() ;
- TObjArray * emcRecPoints = gime->EmcRecPoints() ;
- TObjArray * cpvRecPoints = gime->CpvRecPoints() ;
+ const TClonesArray * digits = gime->Digits(fFrom) ;
+ TObjArray * emcRecPoints = gime->EmcRecPoints(BranchName()) ;
+ TObjArray * cpvRecPoints = gime->CpvRecPoints(BranchName()) ;
Int_t nPar = 3 * nMax ;
Float_t * fitparameters = new Float_t[nPar] ;
// Calculates the Chi square for the cluster unfolding minimization
// Number of parameters, Gradient, Chi squared, parameters, what to do
-
TList * toMinuit = (TList*) gMinuit->GetObjectFit() ;
AliPHOSEmcRecPoint * emcRP = (AliPHOSEmcRecPoint*) toMinuit->At(0) ;
{
// Prints list of RecPoints produced at the current pass of AliPHOSClusterizer
- TObjArray * emcRecPoints = AliPHOSGetter::GetInstance()->EmcRecPoints() ;
- TObjArray * cpvRecPoints = AliPHOSGetter::GetInstance()->CpvRecPoints() ;
+ TObjArray * emcRecPoints = AliPHOSGetter::GetInstance()->EmcRecPoints(BranchName()) ;
+ TObjArray * cpvRecPoints = AliPHOSGetter::GetInstance()->CpvRecPoints(BranchName()) ;
cout << "AliPHOSClusterizerv1: : event "<<gAlice->GetEvNumber() << endl ;
cout << " Found "<< emcRecPoints->GetEntriesFast() << " EMC Rec Points and "
public:
AliPHOSClusterizerv1() ;
- AliPHOSClusterizerv1(const char * headerFile, const char * name = "Default");
+ AliPHOSClusterizerv1(const char * headerFile, const char * name = "Default", const char * from = 0);
virtual ~AliPHOSClusterizerv1() ;
virtual Int_t AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ;
private:
+ const TString BranchName() const ;
void GetCalibrationParameters(void) ;
Bool_t FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy,
private:
+ TString fFrom ; // name of Digits
TString fHeaderFileName ; // name of the file which contains gAlice, Tree headers etc.
TString fDigitsBranchTitle ; // name of the file, where digits branch is stored
TString fRecPointsBranchTitle ; // name of the file, where RecPoints branchs are stored
Int_t fRecPointsInRun ; //! Total number of recpoints in one run
Float_t fEmcTimeGate ; // Maximum time difference between the digits in ont EMC cluster
- ClassDef(AliPHOSClusterizerv1,1) // Clusterizer implementation version 1
+ ClassDef(AliPHOSClusterizerv1,2) // Clusterizer implementation version 1
};
// In principle this class should be called from AliPHOSReconstructioner, but
// one can use it as well in standalone mode.
// Use case:
-// root [0] AliPHOSTrackSegmentMakerv1 * t = new AliPHOSTrackSegmentMaker("galice.root")
+// root [0] AliPHOSTrackSegmentMakerv1 * t = new AliPHOSTrackSegmentMaker("galice.root", "tracksegmentsname", "recpointsname")
// Warning in <TDatabasePDG::TDatabasePDG>: object already instantiated
+// // reads gAlice from header file "galice.root", uses recpoints stored in the branch names "recpointsname" (default = "Default")
+// // and saves recpoints in branch named "tracksegmentsname" (default = "recpointsname")
// root [1] t->ExecuteTask()
// root [2] t->SetMaxEmcPpsdDistance(5)
// root [3] t->SetTrackSegmentsBranch("max distance 5 cm")
// root [4] t->ExecuteTask("deb all time")
//
-//*-- Author: Dmitri Peressounko (RRC Ki & SUBATECH)
+//*-- Author: Dmitri Peressounko (RRC Ki & SUBATECH) & Yves Schutz (SUBATECH)
//
// --- ROOT system ---
fHeaderFileName = "" ;
fRecPointsBranchTitle = "" ;
fTrackSegmentsBranchTitle = "" ;
+ fFrom = "" ;
+
fTrackSegmentsInRun = 0 ;
}
//____________________________________________________________________________
- AliPHOSTrackSegmentMakerv1::AliPHOSTrackSegmentMakerv1(const char * headerFile, const char * name) : AliPHOSTrackSegmentMaker(headerFile, name)
+ AliPHOSTrackSegmentMakerv1::AliPHOSTrackSegmentMakerv1(const char * headerFile, const char * name, const char * from) : AliPHOSTrackSegmentMaker(headerFile, name)
{
// ctor
tsmName.Append(":") ;
tsmName.Append(Version()) ;
SetName(tsmName) ;
-
+ if ( from == 0 )
+ fFrom = name ;
+ else
+ fFrom = from ;
Init() ;
-
+
}
//____________________________________________________________________________
delete fLinkUpArray ;
}
+//____________________________________________________________________________
+const TString AliPHOSTrackSegmentMakerv1::BranchName() const
+{
+ TString branchName(GetName() ) ;
+ branchName.Remove(branchName.Index(Version())-1) ;
+ return branchName ;
+}
+
//____________________________________________________________________________
void AliPHOSTrackSegmentMakerv1::FillOneModule()
{
// Finds first and last indexes between which
// clusters from one PHOS module are
- TString taskName(GetName()) ;
- taskName.Remove(taskName.Index(Version())-1) ;
+
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
- TObjArray * emcRecPoints = gime->EmcRecPoints(taskName) ;
- TObjArray * cpvRecPoints = gime->CpvRecPoints(taskName) ;
+ TObjArray * emcRecPoints = gime->EmcRecPoints(fFrom) ;
+ TObjArray * cpvRecPoints = gime->CpvRecPoints(fFrom) ;
//First EMC clusters
Int_t totalEmc = emcRecPoints->GetEntriesFast() ;
if ( strcmp(GetTitle(), "") == 0 )
SetTitle("galice.root") ;
-
- TString branchname = GetName() ;
- branchname.Remove(branchname.Index(Version())-1) ;
- AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), branchname) ;
+ AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), fFrom.Data()) ;
if ( gime == 0 ) {
cerr << "ERROR: AliPHOSTrackSegmentMakerv1::Init -> Could not obtain the Getter object !" << endl ;
return ;
gime->PostTrackSegmentMaker(this) ;
// create a folder on the white board //YSAlice/WhiteBoard/RecPoints/PHOS/trackSegmentsName
- gime->PostTrackSegments(branchname) ;
+ gime->PostTrackSegments(BranchName()) ;
}
// which are not further apart from each other than fR0
// and sort them in accordance with this distance
- TString taskName(GetName()) ;
- taskName.Remove(taskName.Index(Version())-1) ;
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
- TObjArray * emcRecPoints = gime->EmcRecPoints(taskName) ;
- TObjArray * cpvRecPoints = gime->CpvRecPoints(taskName) ;
+ TObjArray * emcRecPoints = gime->EmcRecPoints(fFrom) ;
+ TObjArray * cpvRecPoints = gime->CpvRecPoints(fFrom) ;
fLinkUpArray->Clear() ;
// unassigned RecParticles. We assign these RecPoints to TrackSegment and
// remove them from the list of "unassigned".
- TString taskName(GetName()) ;
- taskName.Remove(taskName.Index(Version())-1) ;
-
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
- TObjArray * emcRecPoints = gime->EmcRecPoints(taskName) ;
- TObjArray * cpvRecPoints = gime->CpvRecPoints(taskName) ;
- TClonesArray * trackSegments = gime->TrackSegments(taskName) ;
+ TObjArray * emcRecPoints = gime->EmcRecPoints(fFrom) ;
+ TObjArray * cpvRecPoints = gime->CpvRecPoints(fFrom) ;
+ TClonesArray * trackSegments = gime->TrackSegments(BranchName()) ;
//Make arrays to mark clusters already chosen
Int_t * emcExist = 0;
fEmcLast = 0 ;
fCpvFirst = 0 ;
fCpvLast = 0 ;
- gime->TrackSegments(branchname)->Clear() ;
+ gime->TrackSegments(BranchName())->Clear() ;
// if(!ReadRecPoints(ievent)) continue; //reads RecPoints for event ievent
PrintTrackSegments(option) ;
//increment the total number of track segments per run
- fTrackSegmentsInRun += gime->TrackSegments()->GetEntriesFast() ;
+ fTrackSegmentsInRun += gime->TrackSegments(BranchName())->GetEntriesFast() ;
}
AliPHOSGetter *gime = AliPHOSGetter::GetInstance() ;
- TString branchName(GetName() ) ;
- branchName.Remove(branchName.Index(Version())-1) ;
-
- TClonesArray * trackSegments = gime->TrackSegments(branchName) ;
+ TClonesArray * trackSegments = gime->TrackSegments(BranchName()) ;
trackSegments->Expand(trackSegments->GetEntriesFast()) ;
//Make branch in TreeR for TrackSegments
//First TS
Int_t bufferSize = 32000 ;
TBranch * tsBranch = gAlice->TreeR()->Branch("PHOSTS",&trackSegments,bufferSize);
- tsBranch->SetTitle(branchName);
+ tsBranch->SetTitle(BranchName());
if (filename) {
tsBranch->SetFile(filename);
TIter next( tsBranch->GetListOfBranches());
AliPHOSTrackSegmentMakerv1 * ts = this ;
TBranch * tsMakerBranch = gAlice->TreeR()->Branch("AliPHOSTrackSegmentMaker","AliPHOSTrackSegmentMakerv1",
&ts,bufferSize,splitlevel);
- tsMakerBranch->SetTitle(branchName);
+ tsMakerBranch->SetTitle(BranchName());
if (filename) {
tsMakerBranch->SetFile(filename);
TIter next( tsMakerBranch->GetListOfBranches());
public:
AliPHOSTrackSegmentMakerv1() ;
- AliPHOSTrackSegmentMakerv1(const char* headerFile, const char* name = "Default") ;
+ AliPHOSTrackSegmentMakerv1(const char* headerFile, const char* name = "Default", const char * from = 0) ;
AliPHOSTrackSegmentMakerv1(const AliPHOSTrackSegmentMakerv1 & tsm) {
// cpy ctor: no implementation yet
// requested by the Coding Convention
private:
+
+ const TString BranchName() const ;
Float_t GetDistanceInPHOSPlane(AliPHOSEmcRecPoint * EmcClu , AliPHOSRecPoint * Ppsd , Bool_t & TooFar )const ; // see R0
void Init() ;
void PrintTrackSegments(Option_t *option) ;
private:
- TString fHeaderFileName ; // name of the file which contains gAlice, Tree headers etc.
- TString fRecPointsBranchTitle ; // name of the file, where RecPoints branchs are stored
- TString fTrackSegmentsBranchTitle ; // name of the file, where TrackSegment branchs is stored
+ TString fFrom ; // name of Recpoints
+ TString fHeaderFileName ; // name of the file which contains gAlice, Tree headers etc.
+ TString fRecPointsBranchTitle ; // name of the file, where RecPoints branchs are stored
+ TString fTrackSegmentsBranchTitle ; // name of the file, where TrackSegment branchs is stored
+
Int_t fNTrackSegments ; // number of track segments found
-
Float_t fR0 ; // Maximum distance between a EMC RecPoint and a PPSD RecPoint
-
+
TClonesArray * fLinkUpArray ; //!
-
Int_t fEmcFirst; //! Index of first EMC RecPoint belonging to currect PHOS module
Int_t fEmcLast ; //!
Int_t fCpvFirst; //! Cpv upper layer
Int_t fModule ; //! number of module being processed
Int_t fTrackSegmentsInRun ; //! Total number of track segments in one run
- ClassDef( AliPHOSTrackSegmentMakerv1,1) // Implementation version 1 of algorithm class to make PHOS track segments
+ ClassDef( AliPHOSTrackSegmentMakerv1,2) // Implementation version 1 of algorithm class to make PHOS track segments
};