/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ //_________________________________________________________________________ // This is a TTask that constructs ReconstParticles (reconstructed particles) // out of Digits // //-- Authors: Evgeny Karpechev(INR) and Alla Maevsksia ////////////////////////////////////////////////////////////////////////////// // --- ROOT system --- #include "TTask.h" #include "TTree.h" #include "TSystem.h" #include "TFile.h" #include "TROOT.h" #include "TFolder.h" // --- Standard library --- #include #include // --- AliRoot header files --- #include "AliRunLoader.h" #include "AliLoader.h" #include "AliFMDdigit.h" #include "AliFMDhit.h" #include "AliFMDReconstParticles.h" #include "AliFMD.h" #include "AliFMDv1.h" #include "AliFMDReconstruction.h" #include "AliRun.h" #include "AliConfig.h" #include "AliHeader.h" #include "AliGenEventHeader.h" ClassImp(AliFMDReconstruction) //____________________________________________________________________________ AliFMDReconstruction::AliFMDReconstruction():TTask("AliFMDReconstruction","") { fNevents = 0 ; // Number of events to rreconnstraction, 0 means all events in current file fRunLoader = 0x0; } //____________________________________________________________________________ AliFMDReconstruction::AliFMDReconstruction(AliRunLoader* rl):TTask("AliFMDReconstruction","") { if (rl == 0x0) { Fatal("AliFMDReconstruction","Argument AliRunLoader* is null!"); return; } fNevents = 0 ; // Number of events to rreconnstraction, 0 means all events in current file fRunLoader = rl; AliLoader* gime = fRunLoader->GetLoader("FMDLoader"); if (gime == 0x0) { Fatal("AliFMDReconstruction","Can not find FMD (loader) in specified event"); return;//never reached } //add Task to //root/Tasks folder gime->PostReconstructioner(this); } //____________________________________________________________________________ AliFMDReconstruction::~AliFMDReconstruction() { } //____________________________________________________________________________ void AliFMDReconstruction::Exec(Option_t *option) { //Collects all digits in the same active volume into number of particles /* Reconstruct number of particles in given group of pads for given FMDvolume determine by numberOfVolume , numberOfMinSector,numberOfMaxSector, numberOfMinRing, numberOgMaxRing Reconstruction method choose dependence on number of empty pads */ cout<<"\nStart AliFMDReconstruction::Exec(...)"<GetLoader("FMDLoader"); if (gime == 0x0) { Fatal("AliFMDReconstruction","Can not find FMD (loader) in specified event"); return;//never reached } fRunLoader->LoadgAlice(); Int_t retval; retval = gime->LoadHits("READ"); if (retval) { Error("Exec","Error occured while loading hits. Exiting."); return; } retval = gime->LoadDigits("READ"); if (retval) { Error("Exec","Error occured while loading digits. Exiting."); return; } AliFMD * fFMD = (AliFMD *) gAlice->GetDetector("FMD"); TClonesArray *fReconParticles=fFMD->ReconParticles(); TTree* treeD = gime->TreeD(); if (treeD == 0x0) { Error("Exec","Can not get Tree with Digits. Nothing to reconstruct - Exiting"); return; } if(fNevents == 0) fNevents=(Int_t)treeD->GetEntries(); //PH Do we use TreeE (kinematics), or TreeD (digits) toaccess the number //PH of events? //PH if(fNevents == 0) fNevents=(Int_t)gAlice->TreeE()->GetEntries(); //PH cout<<" fNevents "<GetEvent(ievent) ; TTree* treeH = gime->TreeH(); if (treeH == 0x0) { Error("Exec","Can not get TreeH"); return; } cout<<" ievent "<GetBranch("FMD"); if (!brDigits){ cerr<<"EXEC Branch FMD digits not found"<TreeR()==0) gime->MakeTree("R"); //Make branches fFMD->MakeBranch("R"); Int_t zeroADC=1; AliFMDdigit *fmdDigit; if (fFMD) { gime->TreeD()->GetEvent(0); TClonesArray *fFMDdigits=fFMD->Digits(); Int_t nDigits=fFMDdigits->GetEntries(); cout<<" nDigits "<UncheckedAt(digit); ivol=fmdDigit->Volume(); iSector=fmdDigit->NumberOfSector(); iRing=fmdDigit->NumberOfRing(); pedestal=Int_t(gRandom->Gaus(500,250)); padADC[ivol-1][iSector-1][iRing-1]= fmdDigit->ADCsignal() -Int_t(Float_t(pedestal)/channelWidth); if (padADC[ivol-1][iSector-1][iRing-1]<0) padADC[ivol-1][iSector-1][iRing-1]=0; } //digit loop Int_t rmin=0; Int_t rmax=0; //To avoid warning Int_t smin=0; Int_t smax=0; //To avoid warning AliHeader *header = fRunLoader->GetHeader(); AliGenEventHeader* genHeader = header->GenEventHeader(); TArrayF *o = new TArrayF(3); genHeader->PrimaryVertex(*o); Float_t zVertex=o->At(2); for (ivol=0; ivol0.1 ) recParticles[5]= DeterminationByPoisson (padADC,ivol+1,rmin,rmax,smin,smax); else recParticles[5]= DeterminationByThresholds (padADC,ivol+1,rmin,rmax,smin,smax); new((*fReconParticles)[nRecPart++]) AliFMDReconstParticles(recParticles); } // eta } // volume }//if FMD gime->TreeR()->Reset(); gime->TreeR()->Fill(); gime->WriteRecPoints("OVERWRITE"); } //event loop cout<<"\nAliFMDReconstruction::Exec finished"<threshold[i] &&padAdc[volume-1][isector][iring]<=threshold[i+1]) { numPart+=i; break; }; // if in threshol interval }; //threshold_array_size }; //iring }; //sector cout<<"\nEnd threshol method"<