#include <TBrowser.h>
#include <TObjectTable.h>
#include <TRandom.h>
+#include <cassert>
// --- AliRoot header files ---
#include "AliLog.h"
fFirstEvent(0),
fLastEvent(0),
fControlHists(0),
- fHists(0)
+ fHists(0),fCalibData(0x0)
{
// ctor
InitParameters() ;
fFirstEvent(0),
fLastEvent(0),
fControlHists(0),
- fHists(0)
+ fHists(0),fCalibData(0x0)
{
// ctor Init() is called by RunDigitizer
fManager = rd ;
// after that adds contributions from SDigits. This design
// helps to avoid scanning over the list of digits to add
// contribution of any new SDigit.
- static int isTrd1Geom = -1; // -1 - mean undefined
static int nEMC=0; //max number of digits possible
AliRunLoader *rl = AliRunLoader::GetRunLoader();
rl->GetEvent(readEvent);
TClonesArray * digits = emcalLoader->Digits() ;
- digits->Delete() ;
+ digits->Delete() ; //JLK why is this created then deleted?
// Load Geometry
AliEMCALGeometry *geom = 0;
else
AliFatal("Could not get AliRun from runLoader");
- if(isTrd1Geom < 0) {
- AliInfo(Form(" get Geometry %s : %s ", geom->GetName(),geom->GetTitle()));
- TString ng(geom->GetName());
- isTrd1Geom = 0;
- if(ng.Contains("SHISH") && ng.Contains("TRD1")) isTrd1Geom = 1;
-
- if(isTrd1Geom == 0) nEMC = geom->GetNPhi()*geom->GetNZ();
- else nEMC = geom->GetNCells();
- AliDebug(1,Form("nEMC %i (number cells in EMCAL) | %s | isTrd1Geom %i\n", nEMC, geom->GetName(), isTrd1Geom));
- }
+ nEMC = geom->GetNCells();
+ AliDebug(1,Form("nEMC %i (number cells in EMCAL) | %s \n", nEMC, geom->GetName()));
+
Int_t absID ;
digits->Expand(nEMC) ;
AliEMCALDigit * digit ;
AliEMCALDigit * curSDigit ;
- TClonesArray * ticks = new TClonesArray("AliEMCALTick",1000) ;
+ // TClonesArray * ticks = new TClonesArray("AliEMCALTick",1000) ;
//Put Noise contribution
for(absID = 0; absID < nEMC; absID++){ // Nov 30, 2006 by PAI; was from 1 to nEMC
if(absID==nextSig){
//Add SDigits from all inputs
- ticks->Clear() ;
- Int_t contrib = 0 ;
- Float_t a = digit->GetAmp() ;
- Float_t b = TMath::Abs( a /fTimeSignalLength) ;
+ // ticks->Clear() ;
+ //Int_t contrib = 0 ;
+
+ //Follow PHOS and comment out this timing model til a better one
+ //can be developed - JLK 28-Apr-2008
+
+ //Float_t a = digit->GetAmp() ;
+ //Float_t b = TMath::Abs( a /fTimeSignalLength) ;
//Mark the beginning of the signal
- new((*ticks)[contrib++]) AliEMCALTick(digit->GetTime(),0, b);
+ //new((*ticks)[contrib++]) AliEMCALTick(digit->GetTime(),0, b);
//Mark the end of the signal
- new((*ticks)[contrib++]) AliEMCALTick(digit->GetTime()+fTimeSignalLength, -a, -b);
+ //new((*ticks)[contrib++]) AliEMCALTick(digit->GetTime()+fTimeSignalLength, -a, -b);
+
+ // Calculate time as time of the largest digit
+ Float_t time = digit->GetTime() ;
+ Float_t eTime= digit->GetAmp() ;
// loop over input
for(i = 0; i< fInput ; i++){ //loop over (possible) merge sources
else
primaryoffset = i ;
curSDigit->ShiftPrimary(primaryoffset) ;
-
- a = curSDigit->GetAmp() ;
- b = a /fTimeSignalLength ;
- new((*ticks)[contrib++]) AliEMCALTick(curSDigit->GetTime(),0, b);
- new((*ticks)[contrib++]) AliEMCALTick(curSDigit->GetTime()+fTimeSignalLength, -a, -b);
+
+ //Remove old timing model - JLK 28-April-2008
+ //a = curSDigit->GetAmp() ;
+ //b = a /fTimeSignalLength ;
+ //new((*ticks)[contrib++]) AliEMCALTick(curSDigit->GetTime(),0, b);
+ //new((*ticks)[contrib++]) AliEMCALTick(curSDigit->GetTime()+fTimeSignalLength, -a, -b);
+ if(curSDigit->GetAmp()>eTime) {
+ eTime = curSDigit->GetAmp();
+ time = curSDigit->GetTime();
+ }
*digit = *digit + *curSDigit ; //add energies
amp *= static_cast<Float_t>(gRandom->Poisson(fMeanPhotonElectron)) / static_cast<Float_t>(fMeanPhotonElectron) ;
//calculate and set time
- Float_t time = FrontEdgeTime(ticks) ;
+ //New timing model needed - JLK 28-April-2008
+ //Float_t time = FrontEdgeTime(ticks) ;
digit->SetTime(time) ;
//Find next signal module
absID, amp, nextSig));
} // for(absID = 1; absID <= nEMC; absID++)
- ticks->Delete() ;
- delete ticks ;
+ //ticks->Delete() ;
+ //delete ticks ;
delete sdigArray ; //We should not delete its contents
{
// Parameter initialization for digitizer
// Tune parameters - 24-nov-04; Apr 29, 2007
+ // New parameters JLK 14-Apr-2008
- fMeanPhotonElectron = 3300; // electrons per GeV
- fPinNoise = 0.010; // pin noise in GEV from analysis test beam data
+ fMeanPhotonElectron = 4400; // electrons per GeV
+ fPinNoise = 0.037; // pin noise in GEV from analysis test beam data
if (fPinNoise == 0. )
Warning("InitParameters", "No noise added\n") ;
fDigitThreshold = fPinNoise * 3; // 3 * sigma
fInput++ ;
}
+//__________________________________________________________________
void AliEMCALDigitizer::Print1(Option_t * option)
{ // 19-nov-04 - just for convinience
Print();
}
+//__________________________________________________________________
void AliEMCALDigitizer::Browse(TBrowser* b)
{
if(fHists) b->Add(fHists);
TTask::Browse(b);
}
+//__________________________________________________________________
TList *AliEMCALDigitizer::BookControlHists(int var)
{
// 22-nov-04
return fHists;
}
+//__________________________________________________________________
void AliEMCALDigitizer::SaveHists(const char* name, Bool_t kSingleKey, const char* opt)
{
AliEMCALHistoUtilities::SaveListOfHists(fHists, name, kSingleKey, opt);