// //
///////////////////////////////////////////////////////////////////////////////
-
+#include "Riostream.h"
#include "AliITSReconstructor.h"
+#include "AliRun.h"
#include "AliRunLoader.h"
#include "AliRawReader.h"
-#include "AliITSclustererV2.h"
+#include "AliITSDetTypeRec.h"
+#include "AliITSLoader.h"
+#include "AliITStrackerMI.h"
#include "AliITStrackerSA.h"
#include "AliITSVertexerIons.h"
#include "AliITSVertexerFast.h"
#include "AliITSVertexerZ.h"
#include "AliESD.h"
#include "AliITSpidESD.h"
+#include "AliITSpidESD1.h"
+#include "AliITSpidESD2.h"
#include "AliV0vertexer.h"
#include "AliCascadeVertexer.h"
-#include "AliRun.h"
-#include "AliITS.h"
-
+#include "AliITSInitGeometry.h"
ClassImp(AliITSReconstructor)
+//___________________________________________________________________________
+AliITSReconstructor::AliITSReconstructor() : AliReconstructor(){
+ // Default constructor
+ fItsPID=0;
+}
+ //___________________________________________________________________________
+AliITSReconstructor::~AliITSReconstructor(){
+// destructor
+ delete fItsPID;
+}
+//______________________________________________________________________
+AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob) {
+ // Copy constructor
+ // Copies are not allowed. The method is protected to avoid misuse.
+ Error("AliITSpidESD2","Copy constructor not allowed\n");
+}
+//______________________________________________________________________
+AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor& /* ob */){
+ // Assignment operator
+ // Assignment is not allowed. The method is protected to avoid misuse.
+ Error("= operator","Assignment operator not allowed\n");
+ return *this;
+}
+//______________________________________________________________________
+void AliITSReconstructor::Init(AliRunLoader *runLoader){
+ // Initalize this constructor bet getting/creating the objects
+ // nesseary for a proper ITS reconstruction.
+ // Inputs:
+ // AliRunLoader *runLoader Pointer to the run loader to allow
+ // the getting of files/folders data
+ // needed to do reconstruction
+ // Output:
+ // none.
+ // Return:
+ // none.
+
+ AliITSInitGeometry *initgeom = new AliITSInitGeometry("AliITSvPPRasymmFMD",
+ 2);
+ AliITSgeom *geom = initgeom->CreateAliITSgeom();
+ delete initgeom; // once created, do not need initgeom any more.
+ AliITSLoader* loader = static_cast<AliITSLoader*>
+ (runLoader->GetLoader("ITSLoader"));
+ if (!loader) {
+ Error("Init", "ITS loader not found");
+ return;
+ }
+ loader->SetITSgeom(geom);
+ return;
+}
//_____________________________________________________________________________
void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const
{
// reconstruct clusters
- AliLoader* loader = runLoader->GetLoader("ITSLoader");
+
+ AliITSLoader* loader = static_cast<AliITSLoader*>(runLoader->GetLoader("ITSLoader"));
if (!loader) {
Error("Reconstruct", "ITS loader not found");
return;
}
+ AliITSDetTypeRec* rec = new AliITSDetTypeRec(loader);
+ rec->SetDefaults();
+
loader->LoadRecPoints("recreate");
loader->LoadDigits("read");
runLoader->LoadKinematics();
+ TString option = GetOption();
+ Bool_t clusfinder=kTRUE; // Default: V2 cluster finder
+ if(option.Contains("OrigCF"))clusfinder=kFALSE;
- AliITSgeom* geom = GetITSgeom(runLoader);
- if (!geom) return;
- AliITSclustererV2 clusterer(geom);
Int_t nEvents = runLoader->GetNumberOfEvents();
for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
runLoader->GetEvent(iEvent);
-
- TTree* treeClusters = loader->TreeR();
- if (!treeClusters) {
- loader->MakeTree("R");
- treeClusters = loader->TreeR();
- }
- TTree* treeDigits = loader->TreeD();
- if (!treeDigits) {
- Error("Reconstruct", "Can't get digits tree !");
- return;
- }
-
- clusterer.Digits2Clusters(treeDigits, treeClusters);
-
- loader->WriteRecPoints("OVERWRITE");
+ if(loader->TreeR()==0x0) loader->MakeTree("R");
+ rec->MakeBranch("R");
+ rec->SetTreeAddress();
+ rec->DigitsToRecPoints(iEvent,0,"All",clusfinder);
}
loader->UnloadRecPoints();
runLoader->UnloadKinematics();
}
-//_____________________________________________________________________________
-void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader,
- AliRawReader* rawReader) const
+//_________________________________________________________________
+void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader,
+ AliRawReader* rawReader) const
{
-// reconstruct clusters from raw data
+// reconstruct clusters
- AliLoader* loader = runLoader->GetLoader("ITSLoader");
+
+ AliITSLoader* loader = static_cast<AliITSLoader*>(runLoader->GetLoader("ITSLoader"));
if (!loader) {
Error("Reconstruct", "ITS loader not found");
return;
}
- loader->LoadRecPoints("recreate");
- AliITSgeom* geom = GetITSgeom(runLoader);
- if (!geom) return;
- AliITSclustererV2 clusterer(geom);
+ AliITSDetTypeRec* rec = new AliITSDetTypeRec(loader);
+ rec->SetDefaults();
+ rec->SetDefaultClusterFindersV2(kTRUE);
- Int_t iEvent = 0;
- while (rawReader->NextEvent()) {
- runLoader->GetEvent(iEvent++);
+ loader->LoadRecPoints("recreate");
- TTree* treeClusters = loader->TreeR();
- if (!treeClusters) {
- loader->MakeTree("R");
- treeClusters = loader->TreeR();
- }
+ Int_t iEvent = 0;
- clusterer.Digits2Clusters(rawReader);
-
- loader->WriteRecPoints("OVERWRITE");
+ while(rawReader->NextEvent()) {
+ runLoader->GetEvent(iEvent++);
+ if(loader->TreeR()==0x0) loader->MakeTree("R");
+ rec->DigitsToRecPoints(rawReader);
}
loader->UnloadRecPoints();
}
//_____________________________________________________________________________
-AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader) const
+AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader)const
{
// create a ITS tracker
+
AliITSgeom* geom = GetITSgeom(runLoader);
- if (!geom) return NULL;
- return new AliITStrackerSA(geom);
+ TString selectedTracker = GetOption();
+ AliTracker* tracker;
+ if (selectedTracker.Contains("MI")) {
+ tracker = new AliITStrackerMI(geom);
+ }
+ else {
+ tracker = new AliITStrackerSA(geom); // inherits from AliITStrackerMI
+ }
+
+ TString selectedPIDmethod = GetOption();
+ AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
+ if (!loader) {
+ Error("CreateTracker", "ITS loader not found");
+ }
+ if(selectedPIDmethod.Contains("LandauFitPID")){
+ loader->AdoptITSpid(new AliITSpidESD2((AliITStrackerMI*)tracker,loader));
+ }
+ else{
+ Double_t parITS[] = {34., 0.15, 10.};
+ loader->AdoptITSpid(new AliITSpidESD1(parITS));
+ }
+ return tracker;
+
}
//_____________________________________________________________________________
}
//_____________________________________________________________________________
-void AliITSReconstructor::FillESD(AliRunLoader* /*runLoader*/,
+void AliITSReconstructor::FillESD(AliRunLoader* runLoader,
AliESD* esd) const
{
-// make PID, find V0s and cascades
-
- Double_t parITS[] = {34., 0.15, 10.};
- AliITSpidESD itsPID(parITS);
- itsPID.MakePID(esd);
-
+// make PID, find V0s and cascade
+ AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
+ AliITSpidESD *pidESD = 0;
+ TString selectedPIDmethod = GetOption();
+ if(selectedPIDmethod.Contains("LandauFitPID")){
+ Info("FillESD","ITS LandauFitPID option has been selected\n");
+ pidESD=loader->GetITSpid();
+ }
+ else{
+ Info("FillESD","ITS default PID\n");
+ pidESD=loader->GetITSpid();
+ }
+ if(pidESD!=0){
+ pidESD->MakePID(esd);
+ }
+ else {
+ Error("FillESD","!! cannot do the PID !!\n");
+ }
// V0 finding
Double_t cuts[]={33, // max. allowed chi2
0.16,// min. allowed negative daughter's impact parameter
Error("GetITSgeom", "couldn't get AliRun object");
return NULL;
}
- AliITS* its = (AliITS*) runLoader->GetAliRun()->GetDetector("ITS");
- if (!its) {
- Error("GetITSgeom", "couldn't get ITS detector");
- return NULL;
- }
- if (!its->GetITSgeom()) {
- Error("GetITSgeom", "no ITS geometry available");
+ AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
+ AliITSgeom* geom = (AliITSgeom*)loader->GetITSgeom();
+ if(!geom){
+ Error("GetITSgeom","no ITS geometry available");
return NULL;
}
- return its->GetITSgeom();
+
+ return geom;
}