// --- ROOT system ---
#include "TFile.h"
-#include "TTask.h"
-#include "TTree.h"
-#include "TSystem.h"
#include "TROOT.h"
-#include "TFolder.h"
#include "TBenchmark.h"
-#include "TGeometry.h"
// --- Standard library ---
-#include <iomanip.h>
// --- AliRoot header files ---
#include "AliRun.h"
-#include "AliHeader.h"
#include "AliPHOSDigit.h"
-#include "AliPHOSGeometry.h"
#include "AliPHOSGetter.h"
#include "AliPHOSHit.h"
#include "AliPHOSSDigitizer.h"
fDefaultInit = kFALSE ;
}
+//____________________________________________________________________________
+AliPHOSSDigitizer::AliPHOSSDigitizer(const AliPHOSSDigitizer & sd) {
+ //cpy ctor
+
+ fA = sd.fA ;
+ fB = sd.fB ;
+ fPrimThreshold = sd.fPrimThreshold ;
+ fSDigitsInRun = sd.fSDigitsInRun ;
+ fSplitFile = new TFile( (sd.fSplitFile)->GetName(), "new") ;
+ fToSplit = sd.fToSplit ;
+}
+
//____________________________________________________________________________
AliPHOSSDigitizer::~AliPHOSSDigitizer()
{
AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), GetName(),fToSplit) ;
if ( gime == 0 ) {
- cerr << "ERROR: AliPHOSSDigitizer::Init -> Could not obtain the Getter object !"
- << endl ;
+ Error("Init" ,"Could not obtain the Getter object !") ;
return ;
}
//____________________________________________________________________________
void AliPHOSSDigitizer::InitParameters()
{
+ // initializes the parameters for difitization
fA = 0;
fB = 10000000.;
fPrimThreshold = 0.01 ;
if(strstr(option,"tim")){
gBenchmark->Stop("PHOSSDigitizer");
- cout << "AliPHOSSDigitizer:" << endl ;
- cout << " took " << gBenchmark->GetCpuTime("PHOSSDigitizer") << " seconds for SDigitizing "
- << gBenchmark->GetCpuTime("PHOSSDigitizer")/nevents << " seconds per event " << endl ;
- cout << endl ;
+ Info("Exec"," took %f seconds for SDigitizing %f seconds per event",
+ gBenchmark->GetCpuTime("PHOSSDigitizer"), gBenchmark->GetCpuTime("PHOSSDigitizer")/nevents) ;
}
}
const char * sdigitsTitle = sdigitsBranch ->GetTitle() ;
const char * sdigitizerTitle = sdigitizerBranch ->GetTitle() ;
if ( stitle.CompareTo(sdigitsTitle)==0 || stitle.CompareTo(sdigitizerTitle)==0 ){
- cerr << "ERROR: AliPHOSSdigitizer::SetSDigitsBranch -> Cannot overwrite existing branch with title " << title << endl ;
+ Error("SetSDigitsBranch", "Cannot overwrite existing branch with title %s", title) ;
return ;
}
- cout << "AliPHOSSdigitizer::SetSDigitsBranch -> Changing SDigits file from " << GetName() << " to " << title << endl ;
+ Info("SetSDigitsBranch", "-> Changing SDigits file from %s to %s", GetName(), title) ;
SetName(title) ;
void AliPHOSSDigitizer::Print(Option_t* option)const
{
// Prints parameters of SDigitizer
- cout << "------------------- "<< GetName() << " -------------" << endl ;
- cout << " Writing SDigits to branch with title " << GetName() << endl ;
- cout << " with digitization parameters A = " << fA << endl ;
- cout << " B = " << fB << endl ;
- cout << " Threshold for Primary assignment= " << fPrimThreshold << endl ;
- cout << "---------------------------------------------------"<<endl ;
+ TString message ;
+ message = "\n------------------- %s -------------\n" ;
+ message += " Writing SDigits to branch with title %s\n" ;
+ message += " with digitization parameters A = %f\n" ;
+ message += " B = %f\n" ;
+ message += " Threshold for Primary assignment= %f\n" ;
+ message += "---------------------------------------------------\n" ;
+ Info("Print", message.Data(), GetName(), GetName(), fA, fB, fPrimThreshold ) ;
}
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
TString sdname(GetName()) ;
sdname.Remove(sdname.Index(GetTitle())-1) ;
- const TClonesArray * sdigits = gime->SDigits(sdname.Data()) ;
-
- cout << "AliPHOSSDigitiser: event " << gAlice->GetEvNumber() << endl ;
- cout << " Number of entries in SDigits list " << sdigits->GetEntriesFast() << endl ;
- cout << endl ;
+ const TClonesArray * sdigits = gime->SDigits(sdname.Data()) ;
+
+ TString message ;
+ message = "\nAliPHOSSDigitiser: event " ;
+ message += gAlice->GetEvNumber();
+ message += "\n Number of entries in SDigits list " ;
+ message += sdigits->GetEntriesFast() ;
+ char * tempo = new char[8192];
+
if(strstr(option,"all")||strstr(option,"EMC")){
//loop over digits
AliPHOSDigit * digit;
- cout << "EMC sdigits " << endl ;
- cout << "Digit Id Amplitude Index Nprim Primaries list " << endl;
+ message += "\nEMC sdigits\n" ;
+ message += "\n Id Amplitude Time Index Nprim: Primaries list \n" ;
Int_t maxEmc = gime->PHOSGeometry()->GetNModules()*gime->PHOSGeometry()->GetNCristalsInModule() ;
Int_t index ;
for (index = 0 ; (index < sdigits->GetEntriesFast()) &&
((dynamic_cast<AliPHOSDigit *> (sdigits->At(index)))->GetId() <= maxEmc) ; index++) {
digit = dynamic_cast<AliPHOSDigit *>( sdigits->At(index) ) ;
- if(digit->GetNprimary() == 0) continue;
- cout << setw(6) << digit->GetId() << " " << setw(10) << digit->GetAmp() << " "
- << setw(6) << digit->GetIndexInList() << " "
- << setw(5) << digit->GetNprimary() <<" ";
-
+ if(digit->GetNprimary() == 0)
+ continue;
+ sprintf(tempo, "\n%6d %8d %6.5e %4d %2d :",
+ digit->GetId(), digit->GetAmp(), digit->GetTime(), digit->GetIndexInList(), digit->GetNprimary()) ;
+ message += tempo ;
Int_t iprimary;
- for (iprimary=0; iprimary<digit->GetNprimary(); iprimary++)
- cout << setw(5) << digit->GetPrimary(iprimary+1) << " ";
- cout << endl;
+ for (iprimary=0; iprimary<digit->GetNprimary(); iprimary++) {
+ sprintf(tempo, "%d ",digit->GetPrimary(iprimary+1) ) ;
+ message += tempo ;
+ }
}
- cout << endl;
}
if(strstr(option,"all")||strstr(option,"CPV")){
//loop over CPV digits
AliPHOSDigit * digit;
- cout << "CPV sdigits " << endl ;
- cout << "Digit Id Amplitude Index Nprim Primaries list " << endl;
+
+ message += "CPV sdigits\n" ;
+ message += "\n Id Amplitude Index Nprim: Primaries list \n" ;
Int_t maxEmc = gime->PHOSGeometry()->GetNModules()*gime->PHOSGeometry()->GetNCristalsInModule() ;
Int_t index ;
for (index = 0 ; index < sdigits->GetEntriesFast(); index++) {
digit = dynamic_cast<AliPHOSDigit *>( sdigits->At(index) ) ;
if(digit->GetId() > maxEmc){
- cout << setw(6) << digit->GetId() << " " << setw(10) << digit->GetAmp() << " "
- << setw(6) << digit->GetIndexInList() << " "
- << setw(5) << digit->GetNprimary() <<" ";
-
+ sprintf(tempo, "\n%6d %8d %4d %2d :",
+ digit->GetId(), digit->GetAmp(), digit->GetIndexInList(), digit->GetNprimary()) ;
+ message += tempo ;
Int_t iprimary;
- for (iprimary=0; iprimary<digit->GetNprimary(); iprimary++)
- cout << setw(5) << digit->GetPrimary(iprimary+1) << " ";
- cout << endl;
+ for (iprimary=0; iprimary<digit->GetNprimary(); iprimary++) {
+ sprintf(tempo, "%d ",digit->GetPrimary(iprimary+1) ) ;
+ message += tempo ;
+ }
}
}
}
-
+ delete tempo ;
+ Info("PrintSDigits", message.Data() ) ;
}
//____________________________________________________________________________