X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSFDigitizer.cxx;h=e67e5ce1da3a6209ad3cdbc49dbb656eb6098295;hb=09fd162a8b4aa41288dc2c42b821d51a498a1363;hp=6cabedf291461d6d40b3a70cb1d75125362f2d56;hpb=7dab88d3de3a5dec9ba8ba32253a075aade97b77;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSFDigitizer.cxx b/ITS/AliITSFDigitizer.cxx index 6cabedf2914..e67e5ce1da3 100644 --- a/ITS/AliITSFDigitizer.cxx +++ b/ITS/AliITSFDigitizer.cxx @@ -13,45 +13,60 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -*/ +/* $Id$ */ + +////////////////////////////////////////////////////////////////// +// Class for fast reconstruction of recpoints // +// // +// // +////////////////////////////////////////////////////////////////// #include -#include -#include -#include #include -#include -#include #include +#include +#include #include #include "AliITSFDigitizer.h" -// #include "AliITSpList.h" -#include "AliITSmodule.h" #include "AliITSgeom.h" #include "AliITSsimulationFastPoints.h" ClassImp(AliITSFDigitizer) //______________________________________________________________________ -AliITSFDigitizer::AliITSFDigitizer() : AliDigitizer(){ +AliITSFDigitizer::AliITSFDigitizer() : AliDigitizer(), +fITS(0), +fInit(kFALSE){ // // Default constructor. // - fITS = 0; - fInit = kFALSE; } //______________________________________________________________________ -AliITSFDigitizer::AliITSFDigitizer(AliRunDigitizer *mngr) : AliDigitizer(mngr){ +AliITSFDigitizer::AliITSFDigitizer(AliRunDigitizer *mngr) : AliDigitizer(mngr), +fITS(0), +fInit(kFALSE){ // // Standard constructor. // - fITS = 0; - fInit = kFALSE; } +//______________________________________________________________________ +AliITSFDigitizer::AliITSFDigitizer(const AliITSFDigitizer &rec):AliDigitizer(rec), +fITS(rec.fITS), +fInit(rec.fInit){ + // Copy constructor. + +} +//______________________________________________________________________ +AliITSFDigitizer& AliITSFDigitizer::operator=(const AliITSFDigitizer& /*source*/){ + + // Assignment operator. This is a function which is not allowed to be + // done. + Error("operator=","Assignment operator not allowed\n"); + return *this; +} + //______________________________________________________________________ AliITSFDigitizer::~AliITSFDigitizer(){ // @@ -95,34 +110,64 @@ void AliITSFDigitizer::Exec(Option_t* opt){ // Option_t * opt "deb" ... more verbose output // - AliITSsimulationFastPoints *sim = new AliITSsimulationFastPoints(); - - TTree *outputTreeR = fManager->GetTreeR(); - TClonesArray *recPoints = fITS->RecPoints(); -// TBranch *branch = - fITS->MakeBranchInTree(outputTreeR,"ITSRecPointsF", - &recPoints,4000,0); - - Int_t nModules; - fITS->InitModules(-1,nModules); + AliITSsimulationFastPoints *sim = new AliITSsimulationFastPoints(); + AliRunLoader* outrl = AliRunLoader::GetRunLoader( + fManager->GetOutputFolderName()); + if (outrl == 0x0){ + Error("Exec","Can not find Run Loader in output folder."); + return; + } + AliLoader* outgime = outrl->GetLoader("ITSLoader"); + if (outgime == 0x0){ + Error("Exec","Can not get TOF Loader from Output Run Loader."); + return; + } + if(strstr(opt,"deb")){ + Info("Exec","sim=%p, outrl=%p, outgime=%p",sim,outrl,outgime); + } + TTree* outputTreeR = outgime->TreeR(); + if (outputTreeR == 0x0){ + outgime->MakeTree("R"); + outputTreeR = outgime->TreeR(); + } + + TClonesArray* recPoints = new TClonesArray("AliITSRecPoint",1000); + TBranch* branch = outputTreeR->GetBranch("ITSRecPointsF"); + if(branch) branch->SetAddress(recPoints); + else outputTreeR->Branch("ITSRecPointsF",&recPoints); + Int_t nModules; + fITS->InitModules(-1,nModules); // load hits into modules + for (Int_t iFile = 0; iFile < fManager->GetNinputs(); iFile++){ + AliRunLoader* rl = AliRunLoader::GetRunLoader( + fManager->GetInputFolderName(iFile)); + if (rl == 0x0){ + Error("Exec","Can not find Run Loader in input %d folder.",iFile); + return; + } - for (Int_t iFile = 0; iFile < fManager->GetNinputs(); iFile++) { - fITS->FillModules(fManager->GetInputTreeH(iFile), - fManager->GetMask(iFile)); - } + AliLoader* gime = rl->GetLoader("ITSLoader"); + if (gime == 0x0){ + Error("Exec","Can not get TOF Loader from Input %d Run Loader.", + iFile); + return; + } + + gime->LoadHits(); + fITS->FillModules(gime->TreeH(),fManager->GetMask(iFile)); + gime->UnloadHits(); + } // transform hits to fast rec points - AliITSgeom *geom = fITS->GetITSgeom(); - for(Int_t moduleIndex = 0; moduleIndex < geom->GetIndexMax(); moduleIndex++){ - sim->CreateFastRecPoints(moduleIndex); -// branch->Fill(); - outputTreeR->Fill(); - fITS->ResetRecPoints(); - } - outputTreeR->AutoSave(); - + AliITSgeom *geom = fITS->GetITSgeom(); + for(Int_t moduleIndex = 0; moduleIndexGetIndexMax(); moduleIndex++){ + sim->CreateFastRecPoints(moduleIndex,recPoints); + outputTreeR->Fill(); + recPoints->Clear(); + } + outrl->WriteRecPoints("OVERWRITE"); +// outputTreeR->AutoSave(); } ////////////////////////////////////////////////////////////////////////