- if (runLoader == 0x0)
- {
- Error("Exec","Run Loader loader is NULL - Session not opened");
- return;
- }
-
- AliLoader* plFMD = runLoader->GetLoader("FMDLoader");
- if (plFMD == 0x0)
- {
- Fatal("AliFMDReconstructor","Can not find FMD (loader) in specified event");
- return;//never reached
- }
-
- if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
- if (!runLoader->TreeE()) runLoader->LoadHeader();
-
- TDirectory* cwd = gDirectory;
- gDirectory = 0x0;
- Text_t buf1[20];
- TH2F* hTotal[10];
- for (Int_t j=1; j<=5; j++){
- sprintf(buf1,"hTotal%d",j);
-
- hTotal[j] = new TH2F(buf1," Number of primary particles ",
- numberOfSectors[j-1],1,numberOfSectors[j-1],
- numberOfRings[j-1],1,numberOfRings[j-1]);
- }
- gDirectory = cwd;
-
- plFMD->LoadRecPoints("RECREATE");
- Int_t retval=0;
- Int_t nevents=Int_t (runLoader->TreeE()->GetEntries());
-#ifdef DEBUG
- cout<<" nevents "<<nevents<<endl;
-#endif
- for(Int_t ievent=0;ievent<nevents;ievent++)
- {
-#ifdef DEBUG
- cout<<" *** event "<<ievent<<endl;
+ // Current vertex position
+ fCurrentVertex = 0;
+ // Create array of reconstructed strip multiplicities
+ fMult = new TClonesArray("AliFMDRecPoint", 51200);
+ // Create ESD output object
+ fESDObj = new AliESDFMD;
+
+ // Check if we need diagnostics histograms
+ if (!fDiagnostics) return;
+ AliInfo("Making diagnostics histograms");
+ fDiagStep1 = new TH2I("diagStep1", "Read ADC vs. Noise surpressed ADC",
+ 1024, -.5, 1023.5, 1024, -.5, 1023.5);
+ fDiagStep1->SetDirectory(0);
+ fDiagStep1->GetXaxis()->SetTitle("ADC (read)");
+ fDiagStep1->GetYaxis()->SetTitle(Form("ADC (noise surpressed %4.f)",
+ fNoiseFactor));
+ fDiagStep2 = new TH2F("diagStep2", "ADC vs Edep deduced",
+ 1024, -.5, 1023.5, 100, 0, 2);
+ fDiagStep2->SetDirectory(0);
+ fDiagStep2->GetXaxis()->SetTitle("ADC (noise surpressed)");
+ fDiagStep2->GetYaxis()->SetTitle("#Delta E [GeV]");
+ fDiagStep3 = new TH2F("diagStep3", "Edep vs Edep path corrected",
+ 100, 0., 2., 100, 0., 2.);
+ fDiagStep3->SetDirectory(0);
+ fDiagStep3->GetXaxis()->SetTitle("#Delta E [GeV]");
+ fDiagStep3->GetYaxis()->SetTitle("#Delta E/#Delta x #times #delta x [GeV]");
+ fDiagStep4 = new TH2F("diagStep4", "Edep vs Multiplicity deduced",
+ 100, 0., 2., 100, -.1, 19.9);
+ fDiagStep4->SetDirectory(0);
+ fDiagStep4->GetXaxis()->SetTitle("#Delta E/#Delta x #times #delta x [GeV]");
+ fDiagStep4->GetYaxis()->SetTitle("Multiplicity");
+ fDiagAll = new TH2F("diagAll", "Read ADC vs Multiplicity deduced",
+ 1024, -.5, 1023.5, 100, -.1, 19.9);
+ fDiagAll->SetDirectory(0);
+ fDiagAll->GetXaxis()->SetTitle("ADC (read)");
+ fDiagAll->GetYaxis()->SetTitle("Multiplicity");
+}
+
+//____________________________________________________________________
+void
+AliFMDReconstructor::ConvertDigits(AliRawReader* reader,
+ TTree* digitsTree) const
+{
+ // Convert Raw digits to AliFMDDigit's in a tree
+ AliFMDDebug(2, ("Reading raw data into digits tree"));
+ AliFMDRawReader rawRead(reader, digitsTree);
+ // rawRead.SetSampleRate(fFMD->GetSampleRate());
+ rawRead.Exec();
+}
+
+//____________________________________________________________________
+void
+AliFMDReconstructor::GetVertex() const
+{
+ // Return the vertex to use.
+ // This is obtained from the ESD object.
+ // If not found, a warning is issued.
+ fVertexType = kNoVertex;
+ fCurrentVertex = 0;
+ if (fESD) {
+ const AliESDVertex* vertex = fESD->GetVertex();
+ if (vertex) {
+ AliFMDDebug(2, ("Got vertex from ESD: %f", vertex->GetZv()));
+ fCurrentVertex = vertex->GetZv();
+ fVertexType = kESDVertex;
+ return;
+ }
+ }
+ AliWarning("Didn't get any vertex from ESD or generator");
+}
+
+
+//____________________________________________________________________
+void
+AliFMDReconstructor::Reconstruct(AliRawReader* /*reader*/, TTree*) const
+{
+ // Reconstruct directly from raw data (no intermediate output on
+ // digit tree or rec point tree).
+ // Parameters:
+ // reader Raw event reader
+ // ctree Not used.
+ AliError("Method is not used");
+#if 0
+ TClonesArray* array = new TClonesArray("AliFMDDigit");
+ AliFMDRawReader rawRead(reader, 0);
+ rawRead.ReadAdcs(array);
+ ProcessDigits(array);
+ array->Delete();
+ delete array;