Float_t c1 = x1 * x2 / 2;
// Float_t c2 = (x1 + x2) / (x1 * x2);
printf("c1: %f\n", c1);
- Float_t r = (375. / 10000.) * c1 * 256 / (a >> 1);
+ Float_t r = 0;
+ if ( (a >> 1) != 0)
+ r = (375. / 10000.) * c1 * 256 / (a >> 1);
return r;
Float_t y1 = a + b*x1;
static const Int_t fgkNZChannels = 3; // No. of z-channels
static const Int_t fgkNLinks = 12; // No. of links
static const Int_t fgkFixLayer = 2; // which layer is fixed for the generation of the z-channel map
- static const Int_t fgkDeltaY = 39; // accepted deviation in y_proj, default: 9
- static const Int_t fgkDeltaAlpha = 31; // accepted deviation in alpha, default: 11
+ static const Int_t fgkDeltaY = 19; // accepted deviation in y_proj, default: 9
+ static const Int_t fgkDeltaAlpha = 21; // accepted deviation in alpha, default: 11
static const Int_t fgkNRefLayers = 3; // no. of reference layers
static const Float_t fgkBinWidthY; // bin width for y-position
fTrackletTree(0x0)
{
fTrackletTree = new TTree("gtutracklets", "Tree with GTU tracklets");
+ fTrackletTree->SetDirectory(0);
}
AliTRDgtuSim::~AliTRDgtuSim()
if (ListOfTracks->GetEntries() <= 0)
return kTRUE;
- if (!fTrackTree)
+ if (!fTrackTree) {
fTrackTree = new TTree("gtutracks", "GTU tracks");
+ fTrackTree->SetDirectory(0);
+ }
AliTRDtrackGTU *trk = 0x0;
TBranch *branch = fTrackTree->GetBranch("TRDgtuTrack");
alpha = ( 2 * trk->GetdY() - (alpha >> fGtuParam->GetBitExcessAlpha()) + 1 ) >> 1;
trk->SetAlpha(alpha);
- Int_t yproj = trk->GetdY() * (fGtuParam->GetCiYProj(layer));
+ Int_t yproj = -1 * trk->GetdY() * (fGtuParam->GetCiYProj(layer)); //??? sign?
yproj = ( ( ( (yproj >> fGtuParam->GetBitExcessYProj()) + trk->GetYbin() ) >> 2) + 1) >> 1;
trk->SetYProj(yproj);
Bool_t registerTrack = kTRUE;
for (Int_t layerIdx = refLayerIdx; layerIdx > 0; layerIdx--) {
- if (track->IsTrackletInLayer(fGtuParam->GetRefLayer(layerIdx)))
+ if (track->IsTrackletInLayer(fGtuParam->GetRefLayer(layerIdx))) {
+ if ((track->GetTracklet(fGtuParam->GetRefLayer(layerIdx)))->GetSubChannel(zch) > 0) {
+ AliInfo("Not registered");
registerTrack = kFALSE;
+ }
+ }
}
if (registerTrack) {
track->SetZChannel(zch);
{
// get a pointer to the tracklet in the layer specified
- return ((AliTRDtrackletGTU*) (*fTracklets)[layer]);
+ if (IsTrackletInLayer(layer))
+ return ((AliTRDtrackletGTU*) (*fTracklets)[layer]);
+ else
+ return 0x0;
}
Int_t AliTRDtrackGTU::GetNTracklets() const
{
TH1F *h = new TH1F("trkref", "trkref", 100000, 0, 100000);
for (Int_t iTracklet = 0; iTracklet < 6; iTracklet++) {
+ if (!IsTrackletInLayer(iTracklet))
+ continue;
h->Fill( ((AliTRDtrackletGTU*) (*fTracklets)[iTracklet])->GetLabel());
}
if (h->GetEntries() > 0)
- fLabel = h->GetMaximumBin();
+ fLabel = h->GetMaximumBin() - 1;
else
fLabel = -1;
delete h;
Int_t GetPID() const { return fPID; }
Int_t GetSector() const { return fSector; }
Int_t GetStack() const { return fStack; }
+ Int_t GetLabel() const { return fLabel; }
AliESDTrdTrack* CreateTrdTrack() const;
AliTRDtrackletGTU::AliTRDtrackletGTU() :
AliTRDtrackletBase(),
fGtuParam(AliTRDgtuParam::Instance()),
- fTracklet(fgkDummyTracklet),
+ fTracklet(0x0), //fgkDummyTracklet),
fSubChannel(0x0),
fAssignedZ(kFALSE),
fAlpha(0),
// dtor
if (fSubChannel)
delete [] fSubChannel;
+ fTracklet = 0x0;
}
Int_t AliTRDtrackletGTU::Compare(const TObject *o) const {
protected:
AliTRDgtuParam *fGtuParam; //!
- const AliTRDtrackletBase *fTracklet; // always points to a valid tracklet
+ AliTRDtrackletBase *fTracklet; // pointer to the underlying tracklet
Int_t *fSubChannel; //! [AliTRDgtuParam::GetNZChannels()]
Bool_t fAssignedZ; // tracklet assigned to a Z-channel