X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=ITS%2FAliITSDigitizer.cxx;h=014f4a7fb8c47ab8734fc85d6ee844c7518374d0;hp=4c100332ac7d3d41c888b042d3ca2b1ac8e61868;hb=662026ab620a92233de9ed5222c849becc6f5927;hpb=0b572028454c5eca7ba16e509a4a1cdf0fc6e0e4 diff --git a/ITS/AliITSDigitizer.cxx b/ITS/AliITSDigitizer.cxx index 4c100332ac7..014f4a7fb8c 100644 --- a/ITS/AliITSDigitizer.cxx +++ b/ITS/AliITSDigitizer.cxx @@ -13,67 +13,43 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -Revision 1.7 2002/10/25 18:54:22 barbera -Various improvements and updates from B.S.Nilsen and T. Virgili +/* $Id$ */ +/////////////////////////////////////////////////////////////////////////// +//Piotr.Skowronski@cern.ch : // +//Corrections applied in order to compile (only) // +// with new I/O and folder structure // +//To be implemented correctly by responsible // +// // +// Class used to steer // +// the digitization for ITS // +// // +/////////////////////////////////////////////////////////////////////////// -Revision 1.6 2002/10/22 14:45:34 alibrary -Introducing Riostream.h - -Revision 1.5 2002/10/14 14:57:00 hristov -Merging the VirtualMC branch to the main development branch (HEAD) - -Revision 1.3.4.1 2002/06/10 17:51:14 hristov -Merged with v3-08-02 - -Revision 1.4 2002/04/24 22:08:12 nilsen -New ITS Digitizer/merger with two macros. One to make SDigits (old way) and -one to run the merger (modified for Jiri). - -Revision 1.3 2002/03/25 10:48:55 nilsen -New ITS SDigit merging with region of interest cut. Update for changes in -AliDigitizer. Additional optimization should be done. - -Revision 1.2 2002/03/15 17:26:40 nilsen -New SDigit version of ITS Digitizer. - -Revision 1.1 2001/11/27 16:27:28 nilsen -Adding AliITSDigitizer class to do merging and digitization . Based on the -TTask method. AliITSDigitizer class added to the Makefile and ITSLinkDef.h -file. The following files required minor changes. AliITS, added functions -SetHitsAddressBranch, MakeBranchInTreeD and modified MakeBranchD. -AliITSsimulationSDD.cxx needed a Tree independent way of returning back to -the original Root Directory in function Compress1D. Now it uses gDirectory. - -Revision 1.2 2002/03/01 E. Lopez -Digitization changed to start from SDigits instead of Hits. -The SDigits are reading as TClonesArray of AliITSpListItem -*/ -// -// Class used to steer -// the digitization for ITS -// -// -#include -#include +#include +#include #include #include -#include -#include - +#include "AliRun.h" +#include "AliRunLoader.h" +#include "AliLoader.h" +#include "AliLog.h" +#include "AliRunDigitizer.h" #include "AliITSDigitizer.h" #include "AliITSgeom.h" -#include "AliITSpList.h" +#include "AliITSgeomTGeo.h" #include "AliITSsimulation.h" -#include "AliITSDetType.h" - ClassImp(AliITSDigitizer) //______________________________________________________________________ -AliITSDigitizer::AliITSDigitizer() : AliDigitizer(){ +AliITSDigitizer::AliITSDigitizer() : AliDigitizer(), +fITS(0), +fModActive(0), +fInit(kFALSE), +fRoif(-1), +fRoiifile(0), +fFlagFirstEv(kTRUE){ // Default constructor. Assign fITS since it is never written out from // here. // Inputs: @@ -82,15 +58,18 @@ AliITSDigitizer::AliITSDigitizer() : AliDigitizer(){ // none. // Return: // A blank AliITSDigitizer class. + fModActive = new Bool_t[AliITSgeomTGeo::GetNModules()]; + for(Int_t i=0;iGetITSgeom()){ - //cout << "fRoif,fRoiifile="<GetITSgeom()->GetIndexMax()]; - } else{ + } + if(!fITS->GetITSgeom()){ fRoiifile = 0; fInit = kFALSE; Warning("Init","ITS geometry not found"); return fInit; } // end if - // fModActive needs to be set to a default all kTRUE value - for(Int_t i=0;iGetITSgeom()->GetIndexMax();i++) fModActive[i] = kTRUE; -/* This will not work from Init. ts is aways returned as zero. - TTree *ts; - if(fRoif>=0 && fRoiifile>=0 && fRoiifileGetNinputs()){ - ts = GetManager()->GetInputTreeS(fRoiifile); - if(!ts){ - if(!gAlice) ts = gAlice->TreeS(); - if(!ts){ - cout <<"The TTree TreeS needed to set by region not found." - " No region of interest cut will be applied."<< endl; - return fInit; - } // end if - } // end if - cout << "calling SetByReionOfInterest ts="<< ts <GetNinputs(); + Int_t event = GetManager()->GetOutputEventNr(); AliITSsimulation *sim = 0; - AliITSDetType *iDetType = 0; - static Bool_t setDef = kTRUE; - + if(fFlagFirstEv){ + fITS->SetDefaults(); + fITS->SetDefaultSimulation(); + fFlagFirstEv=kFALSE; + } if(!fInit){ - Error("Exec","Init not succesfull, aborting."); + Error("Exec","Init not successful, aborting."); return; } // end if - if( setDef ) fITS->SetDefaultSimulation(); - setDef = kFALSE; - sprintf(name,"%s",fITS->GetName()); + snprintf(name,20,"%s",fITS->GetName()); - Int_t nfiles = GetManager()->GetNinputs(); - Int_t event = GetManager()->GetOutputEventNr(); Int_t size = fITS->GetITSgeom()->GetIndexMax(); Int_t module,id,ifiles,mask; Bool_t lmod; Int_t *fl = new Int_t[nfiles]; fl[0] = fRoiifile; mask = 1; - for(id=0;idGetOutputFolderName()); + if ( outRL == 0x0) + { + Error("Exec","Can not get Output Run Loader"); + delete [] fl; + return; + } + outRL->GetEvent(event); + outgime = outRL->GetLoader(loadname); + if ( outgime == 0x0) + { + Error("Exec","Can not get Output ITS Loader"); + delete [] fl; + return; + } + + outgime->LoadDigits("update"); + if (outgime->TreeD() == 0x0) outgime->MakeTree("D"); + // Digitize - fITS->MakeBranchInTreeD(GetManager()->GetTreeD()); - if(fRoif!=0) Info("AliITSDigitizer","Region of Interest digitization selected"); - else Info("AliITSDigitizer","No Region of Interest selected. Digitizing everything"); - //cout <<"fModActive="<GetITSgeom()->GetModuleType(module); - if(!all && !det[id]) continue; - iDetType = fITS->DetType( id ); - sim = (AliITSsimulation*)iDetType->GetSimulationModel(); - if(!sim) { + + for(ifiles=0; ifilesGetInputFolderName(fl[ifiles])); + ingime = inRL->GetLoader(loadname); + if (ingime->TreeS() == 0x0) ingime->LoadSDigits(); + } + + for(module=0; moduleGetITSgeom()->GetModuleType(module); + if(!all && !det[id]) continue; + sim = (AliITSsimulation*)fITS->GetSimulationModel(id); + if(!sim) { Error( "Exec", "The simulation class was not instanciated!" ); exit(1); } // end if !sim - - // Fill the module with the sum of SDigits + // Fill the module with the sum of SDigits sim->InitSimulationModule(module, event); //cout << "Module=" << module; - for(ifiles=0; ifilesClear(); @@ -257,29 +256,36 @@ void AliITSDigitizer::Exec(Option_t* opt){ // add summable digits to module brchSDigits->GetEvent( module ); lmod = sim->AddSDigitsToModule(sdig,mask); - if(ifiles==0){ - fModActive[module] = lmod; - } // end if - //cout << " fModActive["<Digits - sim->FinishSDigitiseModule(); + sim->FinishSDigitiseModule(); // fills all branches - wasted disk space - GetManager()->GetTreeD()->Fill(); - fITS->ResetDigits(); + outgime->TreeD()->Fill(); + fITS->ResetDigits(); } // end for module - //cout << "end modules loop"<GetTreeD()->AutoSave(); + fITS->WriteFOSignals(); + outgime->TreeD()->AutoSave(); + outgime->WriteDigits("OVERWRITE"); + outgime->UnloadDigits(); + for(ifiles=0; ifilesGetInputFolderName(fl[ifiles])); + ingime = inRL->GetLoader(loadname); + ingime->UnloadSDigits(); + } delete[] fl; sdig->Clear(); delete sdig; for(Int_t i=0;iGetITSgeom()->GetIndexMax();i++) fModActive[i] = kTRUE; + + return; } //______________________________________________________________________ @@ -307,29 +313,28 @@ void AliITSDigitizer::SetByRegionOfInterest(TTree *ts){ //cout << "Region of Interest ts="<GetITSgeom()->GetIndexMax(); for(m=0;mClear(); delete sdig; return;