#include <TTree.h>
#include <TBranch.h>
-#include <AliRun.h>
-#include <AliRunLoader.h>
-#include <AliLoader.h>
-#include <AliRunDigitizer.h>
+#include "AliRun.h"
+#include "AliRunLoader.h"
+#include "AliLoader.h"
+#include "AliLog.h"
+#include "AliRunDigitizer.h"
#include "AliITSDigitizer.h"
#include "AliITSgeom.h"
+#include "AliITSgeomTGeo.h"
#include "AliITSsimulation.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:
// none.
// Return:
// A blank AliITSDigitizer class.
+ fModActive = new Bool_t[AliITSgeomTGeo::GetNModules()];
+ for(Int_t i=0;i<AliITSgeomTGeo::GetNModules();i++) fModActive[i] = kTRUE;
- fITS = 0;
- fModActive = 0;
- fRoif = -1;
- fRoiifile = 0;
- fInit = kFALSE;
- fFlagFirstEv =kTRUE;
}
//______________________________________________________________________
-AliITSDigitizer::AliITSDigitizer(AliRunDigitizer *mngr) : AliDigitizer(mngr){
+AliITSDigitizer::AliITSDigitizer(AliRunDigitizer *mngr) : AliDigitizer(mngr),
+fITS(0),
+fModActive(0),
+fInit(kFALSE),
+fRoif(-1),
+fRoiifile(0),
+fFlagFirstEv(kTRUE){
// Standard constructor. Assign fITS since it is never written out from
// here.
// Inputs:
// none.
// Return:
// An AliItSDigitizer class.
-
- fITS = 0;
- fModActive = 0;
- fRoif = -1;
- fRoiifile = 0;
- fInit = kFALSE;
- fFlagFirstEv =kTRUE;
+ fModActive = new Bool_t[AliITSgeomTGeo::GetNModules()];
+ for(Int_t i=0;i<AliITSgeomTGeo::GetNModules();i++) fModActive[i] = kTRUE;
}
-//______________________________________________________________________
-AliITSDigitizer::AliITSDigitizer(const AliITSDigitizer &/*rec*/):AliDigitizer(/*rec*/){
- // Copy constructor.
-
- Error("Copy constructor","Copy constructor not allowed");
-
-}
-//______________________________________________________________________
-AliITSDigitizer& AliITSDigitizer::operator=(const AliITSDigitizer& /*source*/){
- // Assignment operator. This is a function which is not allowed to be
- // done.
- Error("operator=","Assignment operator not allowed\n");
- return *this;
-}
//______________________________________________________________________
AliITSDigitizer::~AliITSDigitizer(){
fInit = kFALSE;
Warning("Init","ITS not found");
return fInit;
- } else if(fITS->GetITSgeom()){
- //cout << "fRoif,fRoiifile="<<fRoif<<" "<<fRoiifile<<endl;
- fModActive = new Bool_t[fITS->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;i<fITS->GetITSgeom()->GetIndexMax();i++) fModActive[i] = kTRUE;
return fInit;
}
//______________________________________________________________________
// Return:
// none.
- char name[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+ char name[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
const char *all;
const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
strstr(opt,"SSD")};
return;
} // end if
- sprintf(name,"%s",fITS->GetName());
+ snprintf(name,20,"%s",fITS->GetName());
Int_t size = fITS->GetITSgeom()->GetIndexMax();
Int_t module,id,ifiles,mask;
if ( outRL == 0x0)
{
Error("Exec","Can not get Output Run Loader");
+ delete [] fl;
return;
}
outRL->GetEvent(event);
if ( outgime == 0x0)
{
Error("Exec","Can not get Output ITS Loader");
+ delete [] fl;
return;
}
// Digitize
fITS->MakeBranchInTreeD(outgime->TreeD());
- if(fRoif!=0) Info("AliITSDigitizer","Region of Interest digitization selected");
- else Info("AliITSDigitizer","No Region of Interest selected. Digitizing everything");
- //cout <<"fModActive="<<fModActive<<" fRoif="<<fRoif;
- if(fModActive==0) fRoif = 0; // fModActive array must be define for RIO cuts.
- //cout <<" fRoif="<<fRoif<<endl;
+ if(fRoif!=0) {
+ AliDebug(1,"Region of Interest digitization selected");
+ }
+ else {
+ AliDebug(1,"No Region of Interest selected. Digitizing everything");
+ }
+
for(ifiles=0; ifiles<nfiles; ifiles++ )
{
for(module=0; module<size; module++ )
{
- if(fModActive && fRoif!=0) if(!fModActive[module]) continue;
+ if(fRoif!=0) if(!fModActive[module]) continue;
id = fITS->GetITSgeom()->GetModuleType(module);
if(!all && !det[id]) continue;
sim = (AliITSsimulation*)fITS->GetSimulationModel(id);
TTree *treeS = ingime->TreeS();
fITS->SetTreeAddress();
- if( !(treeS && fITS->GetSDigits()) ) continue;
+ if( !treeS ) continue;
TBranch *brchSDigits = treeS->GetBranch( name );
if( brchSDigits )
{
} else {
Error( "Exec", "branch ITS not found in TreeS, input file %d ",
ifiles );
+ delete [] fl;
return;
} // end if brchSDigits
sdig->Clear();
nm = fITS->GetITSgeom()->GetIndexMax();
for(m=0;m<nm;m++){
- //cout << " fModActive["<<m<<"]=";
fModActive[m] = kFALSE; // Not active by default
sdig->Clear();
brchSDigits->GetEvent(m);
//cout << fModActive[m];
//cout << endl;
} // end for m
- Info("AliITSDigitizer","Digitization by Region of Interest selected");
+ AliDebug(1,"Digitization by Region of Interest selected");
sdig->Clear();
delete sdig;
return;