* provided "as is" without express or implied warranty. *
**************************************************************************/
-//_________________________________________________________________________
-// This is a TTask that makes TOF-Digits out of TOF-SDigits.
-// The simulation of the detector is performed at sdigits level:
-// during digitization the unique task is the sum of all sdigits in the
-// same pad.
-// Digits are written to TreeD in branch "TOF".
-//
-// -- Author : F. Pierella (Bologna University) pierella@bo.infn.it
-//////////////////////////////////////////////////////////////////////////////
-
-
-#include <stdlib.h>
+//_________________________________________________________________________//
+// //
+// This is a TTask that makes TOF-Digits out of TOF-SDigits. //
+// The simulation of the detector is performed at sdigits level: //
+// during digitization the unique task is the sum of all sdigits in the //
+// same pad. //
+// Digits are written to TreeD in branch "TOF". //
+// //
+// -- Author : F. Pierella (Bologna University) pierella@bo.infn.it //
+// //
+//_________________________________________________________________________//
+
#include <Riostream.h>
-#include <TTree.h>
-#include <TVector.h>
-#include <TObjArray.h>
+
#include <TFile.h>
-#include <TDirectory.h>
+#include <TH1F.h>
+#include <TTree.h>
#include <TRandom.h>
-#include "TF1.h"
-#include "TH1F.h"
-#include "TList.h"
-#include "TRandom.h"
-#include "AliLog.h"
-#include "AliRun.h"
-#include "AliRunLoader.h"
#include "AliLoader.h"
-#include "AliDigitizer.h"
+#include "AliLog.h"
#include "AliRunDigitizer.h"
-#include "AliPDG.h"
+#include "AliRunLoader.h"
+#include "AliRun.h"
-#include "AliTOF.h"
+#include "AliTOFCal.h"
+#include "AliTOFcalib.h"
+#include "AliTOFChannel.h"
#include "AliTOFDigitizer.h"
-#include "AliTOFSDigitizer.h"
-#include "AliTOFhit.h"
#include "AliTOFdigit.h"
-#include "AliTOFSDigit.h"
#include "AliTOFHitMap.h"
-#include "AliTOFChannel.h"
-#include "AliTOFCal.h"
#include "AliTOFGeometryV5.h"
+#include "AliTOFSDigit.h"
+#include "AliTOF.h"
ClassImp(AliTOFDigitizer)
//___________________________________________
- AliTOFDigitizer::AliTOFDigitizer() :AliDigitizer()
+ AliTOFDigitizer::AliTOFDigitizer() :
+ AliDigitizer(),
+ fGeom(0x0),
+ fDigits(0x0),
+ fSDigitsArray(0x0),
+ fhitMap(0x0)
{
// Default ctor - don't use it
- fDigits=0;
- fSDigitsArray=0;
- fhitMap=0;
- fGeom=0x0;
}
//___________________________________________
-AliTOFDigitizer::AliTOFDigitizer(AliRunDigitizer* manager)
- :AliDigitizer(manager)
+AliTOFDigitizer::AliTOFDigitizer(AliRunDigitizer* manager):
+ AliDigitizer(manager),
+ fGeom(0x0),
+ fDigits(0x0),
+ fSDigitsArray(0x0),
+ fhitMap(0x0)
{
//ctor with RunDigitizer
- fDigits=0;
- fSDigitsArray=0;
- fhitMap=0;
- fGeom=0x0;
+}
+
+//------------------------------------------------------------------------
+AliTOFDigitizer::AliTOFDigitizer(const AliTOFDigitizer &source):
+ AliDigitizer(source),
+ fGeom(0x0),
+ fDigits(0),
+ fSDigitsArray(0),
+ fhitMap(0)
+{
+ // copy constructor
+ this->fDigits=source.fDigits;
+ this->fSDigitsArray=source.fSDigitsArray;
+ this->fhitMap=source.fhitMap;
+ this->fGeom=source.fGeom;
+
+}
+
+//------------------------------------------------------------------------
+ AliTOFDigitizer& AliTOFDigitizer::operator=(const AliTOFDigitizer &source)
+{
+ // ass. op.
+ this->fDigits=source.fDigits;
+ this->fSDigitsArray=source.fSDigitsArray;
+ this->fhitMap=source.fhitMap;
+ this->fGeom=source.fGeom;
+ return *this;
+
}
//------------------------------------------------------------------------
// start loop on number of slots for current sdigit
for (Int_t islot = 0; islot < nslot; islot++) {
- Float_t digit[2]; // TOF digit variables
- Int_t tracknum[kMAXDIGITS]; // contributing tracks for the current slot
+ Float_t digit[4] = {-1.,-1.,-1.,-1.}; // TOF digit variables
+ Int_t tracknum[AliTOFSDigit::kMAXDIGITS]; // contributing tracks for the current slot
Float_t tdc=tofsdigit->GetTdc(islot); digit[0]=tdc;
Float_t adc=tofsdigit->GetAdc(islot); digit[1]=adc;
//_____________________________________________________________________________
void AliTOFDigitizer::InitDecalibration( AliTOFcalib *calib) const {
- calib->ReadSimParFromCDB("TOF/Calib", 0);
+ // calib->ReadSimParFromCDB("TOF/Calib", 0); // original
+ calib->ReadSimParFromCDB("TOF/Calib", -1); // use AliCDBManager's number
}
//---------------------------------------------------------------------
void AliTOFDigitizer::DecalibrateTOFSignal( AliTOFcalib *calib){
AliTOFCal * cal= calib->GetTOFCalSimArray();
- AliInfo(Form("Size of AliTOFCal = %i",cal->NPads()));
+ AliDebug(2,Form("Size of AliTOFCal = %i",cal->NPads()));
for (Int_t ipad = 0 ; ipad<cal->NPads(); ipad++){
AliTOFChannel *calChannel = cal->GetChannel(ipad);
Float_t par[6];
}
Int_t index = calib->GetIndex(detId);
AliTOFChannel *calChannel = cal->GetChannel(index);
+ // time slewing parameters
Float_t par[6];
for (Int_t j = 0; j<6; j++){
par[j]=calChannel->GetSlewPar(j);
if(par[j]!=0)dbEntry=kTRUE;
}
-
+ // the global time shift
+ Float_t timedelay = calChannel->GetDelay();
Float_t tToT= dig->GetToT();
dig->SetTdcND(dig->GetTdc());
Float_t tdc = ((dig->GetTdc())*AliTOFGeometry::TdcBinWidth()+32)*1.E-3; //tof signal in ns
- Float_t timeoffset=par[0] + tToT*par[1] +tToT*tToT*par[2] +tToT*tToT*tToT*par[3] +tToT*tToT*tToT*tToT*par[4] +tToT*tToT*tToT*tToT*tToT*par[5];
- Float_t timeSlewed = tdc + timeoffset;
+ // add slewing effect
+ Float_t timeoffset=par[0] + tToT*(par[1] +tToT*(par[2] +tToT*(par[3] +tToT*(par[4] +tToT*par[5]))));
+ Float_t timeSlewed = tdc+timeoffset;
+ // add global time shift
+ timeSlewed = timeSlewed + timedelay;
+
// Setting Decalibrated Time signal
dig->SetTdc((timeSlewed*1E3-32)/AliTOFGeometry::TdcBinWidth());
}
if(hToT->GetEntries()<=0 || !dbEntry){
- AliInfo("Standard Production, no miscalibrated digits");
+ AliDebug(1,"Standard Production, no miscalibrated digits");
}else{
- AliInfo("Miscalibrated digits");
+ AliDebug(1,"Miscalibrated digits");
}
return;