//__________________________________________________________//
#include <TBenchmark.h>
+#include <TClonesArray.h>
#include <TF1.h>
#include <TFile.h>
#include <TParticle.h>
#include <TTree.h>
#include <TRandom.h>
+#include <TROOT.h>
#include "AliLoader.h"
#include "AliLog.h"
#include "AliTOFSDigit.h"
#include "AliTOF.h"
+extern TROOT *gROOT;
ClassImp(AliTOFSDigitizer)
fHeadersFile(""),
fRunLoader(0x0),
fTOFLoader(0x0),
- fTOFGeometry(new AliTOFGeometry()),
fSelectedSector(-1),
fSelectedPlate(-1),
fTimeResolution(0),
fHeadersFile(""),
fRunLoader(0x0),
fTOFLoader(0x0),
- fTOFGeometry(0x0),
fSelectedSector(-1),
fSelectedPlate(-1),
fTimeResolution(0),
fAdcRms(0)
{
// copy constructor
- this->fTOFGeometry=source.fTOFGeometry;
+ //this->fTOFGeometry=source.fTOFGeometry;
}
//____________________________________________________________________________
-AliTOFSDigitizer& AliTOFSDigitizer::operator=(const AliTOFSDigitizer &source)
+AliTOFSDigitizer& AliTOFSDigitizer::operator=(const AliTOFSDigitizer &/*source*/)
{
// ass. op.
- this->fTOFGeometry=source.fTOFGeometry;
return *this;
}
fHeadersFile(HeaderFile), // input filename (with hits)
fRunLoader(0x0),
fTOFLoader(0x0),
- fTOFGeometry(0x0),
fSelectedSector(-1), // by default we sdigitize all sectors
fSelectedPlate(-1), // by default we sdigitize all plates in all sectors
fTimeResolution(0),
return;
}
+ /*
fRunLoader->CdGAFile();
TDirectory *savedir=gDirectory;
TFile *in=(TFile*)gFile;
+
+// when fTOFGeometry was needed
if (!in->IsOpen()) {
AliWarning("Geometry file is not open default TOF geometry will be used");
fTOFGeometry = new AliTOFGeometry();
in->cd();
fTOFGeometry = (AliTOFGeometry*)in->Get("TOFgeometry");
}
-
+
savedir->cd();
-
+ */
if (fRunLoader->TreeE() == 0x0) fRunLoader->LoadHeader();
if (evNumber1>=0) fEvent1 = evNumber1;
// dtor
fTOFLoader->CleanSDigitizer();
- delete fTOFGeometry;
-
}
//____________________________________________________________________________
TClonesArray *tofHitArray = tof->Hits();
// create hit map
- AliTOFHitMap *hitMap = new AliTOFHitMap(tof->SDigits(), fTOFGeometry);
+ // AliTOFHitMap *hitMap = new AliTOFHitMap(tof->SDigits(), fTOFGeometry);
+ AliTOFHitMap *hitMap = new AliTOFHitMap(tof->SDigits());
TBranch * tofHitsBranch = hitTree->GetBranch("TOF");
Int_t ntracks = static_cast<Int_t>(hitTree->GetEntries());
for (Int_t track = 0; track < ntracks; track++)
{
- gAlice->ResetHits();
+ gAlice->GetMCApp()->ResetHits();
tofHitsBranch->GetEvent(track);
AliMC *mcApplication = (AliMC*)gAlice->GetMCApp();
for (Int_t hit = 0; hit < nhits; hit++) {
Int_t vol[5]; // location for a digit
- Float_t digit[2]; // TOF digit variables
+ Int_t digit[2]; // TOF digit variables
Int_t tracknum;
Float_t dxPad;
Float_t dzPad;
// fp: really sorry for this, it is a temporary trick to have
// track length too
- if(version!=6 && version!=7){
+ if (version<6) { //(version!=6 && version!=7)
AliTOFhit *tofHit = (AliTOFhit *) tofHitArray->UncheckedAt(hit);
tracknum = tofHit->GetTrack();
vol[0] = tofHit->GetSector();
}
geantTime *= 1.e+09; // conversion from [s] to [ns]
-
+ // TOF matching window (~200ns) control
+ if (geantTime>=AliTOFGeometry::MatchingWindow()*1E-3) {
+ AliDebug(2,Form("Time measurement (%f) greater than the matching window (%f)",
+ geantTime, AliTOFGeometry::MatchingWindow()*1E-3));
+ continue;
+ }
+
// selection case for sdigitizing only hits in a given plate of a given sector
if(thereIsNotASelection || (vol[0]==fSelectedSector && vol[1]==fSelectedPlate)){
for(Int_t indexOfPad=0; indexOfPad<nActivatedPads; indexOfPad++) {
if(isFired[indexOfPad]){ // the pad has fired
Float_t timediff=geantTime-tofAfterSimul[indexOfPad];
-
- if(timediff>=0.2) nlargeTofDiff++;
+
+ // TOF matching window (~200ns) control
+ if (tofAfterSimul[indexOfPad]>=AliTOFGeometry::MatchingWindow()*1E-3) {
+ AliDebug(2,Form("Time measurement (%f) greater than the matching window (%f)",
+ tofAfterSimul[indexOfPad], AliTOFGeometry::MatchingWindow()*1E-3));
+ continue;
+ }
+
+ if(timediff>=0.2) nlargeTofDiff++; // greater than 200ps
digit[0] = (Int_t) ((tofAfterSimul[indexOfPad]*1.e+03)/AliTOFGeometry::TdcBinWidth()); // TDC bin number (each bin -> 24.4 ps)
if (tof->SDigits()) tof->ResetSDigits();
- if (strstr(verboseOption,"all")) {
- AliInfo("----------------------------------------");
- AliInfo(" <AliTOFSDigitizer> ");
- AliInfo(Form("After sdigitizing %d hits in event %d", nselectedHitsinEv, iEvent));
+ if (strstr(verboseOption,"all") || strstr(verboseOption,"partial")) {
+ AliDebug(2,"----------------------------------------");
+ AliDebug(2,Form("After sdigitizing %d hits in event %d", nselectedHitsinEv, iEvent));
//" (" << nHitsFromPrim << " from primaries and " << nHitsFromSec << " from secondaries) TOF hits, "
- AliInfo(Form("%d digits have been created", ntotalsdigitsinEv));
- AliInfo(Form("(%d due to signals and %d due to border effect)", nsignalsdigitsinEv, nnoisesdigitsinEv));
- AliInfo(Form("%d total updates of the hit map have been performed in current event", ntotalupdatesinEv));
- AliInfo("----------------------------------------");
+ AliInfo(Form("%d sdigits have been created", ntotalsdigitsinEv));
+ AliDebug(2,Form("(%d due to signals and %d due to border effect)", nsignalsdigitsinEv, nnoisesdigitsinEv));
+ AliDebug(2,Form("%d total updates of the hit map have been performed in current event", ntotalupdatesinEv));
+ AliDebug(2,"----------------------------------------");
}
} //event loop on events
}
nHitsFromSec=nselectedHits-nHitsFromPrim;
- if(strstr(verboseOption,"all")){
- AliInfo("----------------------------------------");
- AliInfo("----------------------------------------");
- AliInfo("-----------SDigitization Summary--------");
- AliInfo(" <AliTOFSDigitizer> ");
- AliInfo(Form("After sdigitizing %d hits", nselectedHits));
- AliInfo(Form("in %d events", fEvent2-fEvent1));
-//" (" << nHitsFromPrim << " from primaries and " << nHitsFromSec << " from secondaries) TOF hits, "
- AliInfo(Form("%d sdigits have been created", ntotalsdigits));
- AliInfo(Form("(%d due to signals and "
- "%d due to border effect)", nsignalsdigits, nnoisesdigits));
- AliInfo(Form("%d total updates of the hit map have been performed", ntotalupdates));
- AliInfo(Form("in %d cases the time of flight difference is greater than 200 ps", nlargeTofDiff));
+ if (strstr(verboseOption,"all") || strstr(verboseOption,"partial")) {
+ AliDebug(2,"----------------------------------------");
+ AliDebug(2,Form("After sdigitizing %d hits in %d events ", nselectedHits, fEvent2-fEvent1));
+ //" (" << nHitsFromPrim << " from primaries and " << nHitsFromSec << " from secondaries) TOF hits, "
+ AliDebug(2,Form("%d sdigits have been created", ntotalsdigits));
+ AliDebug(2,Form("(%d due to signals and %d due to border effect)", nsignalsdigits, nnoisesdigits));
+ AliDebug(2,Form("%d total updates of the hit map have been performed", ntotalupdates));
+ AliDebug(2,Form("in %d cases the time of flight difference is greater than 200 ps", nlargeTofDiff));
+ AliDebug(2,"----------------------------------------");
}