#include <TVector.h>
#include <TVirtualMC.h>
#include <TGeoManager.h>
+#include <TGeoPhysicalNode.h>
#include "AliConst.h"
#include "AliLog.h"
gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
+ // Add the tracking to local matrix following the TPC example
+ TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntry(symName.Data());
+ const char *path = alignableEntry->GetTitle();
+ if (!gGeoManager->cd(path)) {
+ AliFatal(Form("Volume path %s not valid!",path));
+ }
+ TGeoHMatrix *globMatrix = gGeoManager->GetCurrentMatrix();
+ Double_t sectorAngle = 20.0 * (isect % 18) + 10.0;
+ TGeoHMatrix *t2lMatrix = new TGeoHMatrix();
+ t2lMatrix->RotateZ(sectorAngle);
+ t2lMatrix->MultiplyLeft(&(globMatrix->Inverse()));
+ alignableEntry->SetMatrix(t2lMatrix);
+
}
}
}
,det
,posHit
,-q
- ,kTRUE);
+ ,gMC->TrackTime()*1.0e06
+ ,kTRUE);
}
Bool_t drRegion = kFALSE;
Bool_t amRegion = kFALSE;
+ TString cIdPath;
+ Char_t cIdSector[3];
+ cIdSector[2] = 0;
+
TString cIdCurrent;
TString cIdSensDr = "J";
TString cIdSensAm = "K";
hits[1] = pos[1];
hits[2] = pos[2];
- // The sector number (0 - 17)
- // The numbering goes clockwise and starts at y = 0
- Float_t phi = kRaddeg*TMath::ATan2(pos[0],pos[1]);
- if (phi < 90.0) {
- phi = phi + 270.0;
- }
- else {
- phi = phi - 90.0;
- }
- sec = ((Int_t) (phi / 20.0));
+ // The sector number (0 - 17), according to standard coordinate system
+ cIdPath = gGeoManager->GetPath();
+ cIdSector[0] = cIdPath[21];
+ cIdSector[1] = cIdPath[22];
+ sec = atoi(cIdSector);
// The plane and chamber number
cIdChamber[0] = cIdCurrent[2];
cIdChamber[1] = cIdCurrent[3];
Int_t idChamber = (atoi(cIdChamber) % kNdetsec);
- cha = kNcham - ((Int_t) idChamber / kNplan) - 1;
+ cha = ((Int_t) idChamber / kNplan);
pla = ((Int_t) idChamber % kNplan);
// The detector number
,det
,hits
,qTot
+ ,gMC->TrackTime()*1.0e06
,drRegion);
}
Bool_t drRegion = kFALSE;
Bool_t amRegion = kFALSE;
+ TString cIdPath;
+ Char_t cIdSector[3];
+ cIdSector[2] = 0;
+
TString cIdCurrent;
TString cIdSensDr = "J";
TString cIdSensAm = "K";
hits[1] = pos[1];
hits[2] = pos[2];
- // The sector number (0 - 17)
- // The numbering goes clockwise and starts at y = 0
- Float_t phi = kRaddeg*TMath::ATan2(pos[0],pos[1]);
- if (phi < 90.0) {
- phi = phi + 270.0;
- }
- else {
- phi = phi - 90.0;
- }
- sec = ((Int_t) (phi / 20.0));
+ // The sector number (0 - 17), according to standard coordinate system
+ cIdPath = gGeoManager->GetPath();
+ cIdSector[0] = cIdPath[21];
+ cIdSector[1] = cIdPath[22];
+ sec = atoi(cIdSector);
// The plane and chamber number
cIdChamber[0] = cIdCurrent[2];
cIdChamber[1] = cIdCurrent[3];
Int_t idChamber = (atoi(cIdChamber) % kNdetsec);
- cha = kNcham - ((Int_t) idChamber / kNplan) - 1;
+ cha = ((Int_t) idChamber / kNplan);
pla = ((Int_t) idChamber % kNplan);
// The detector number
,det
,hits
,qTot
+ ,gMC->TrackTime()*1.0e06
,kTRUE);
}
else {
,det
,hits
,qTot
+ ,gMC->TrackTime()*1.0e06
,kFALSE);
}
Bool_t drRegion = kFALSE;
Bool_t amRegion = kFALSE;
+ TString cIdPath;
+ Char_t cIdSector[3];
+ cIdSector[2] = 0;
+
TString cIdCurrent;
TString cIdSensDr = "J";
TString cIdSensAm = "K";
Char_t cIdChamber[3];
- cIdChamber[2] = 0;
+ cIdChamber[2] = 0;
TLorentzVector pos;
TLorentzVector mom;
hits[1] = pos[1];
hits[2] = pos[2];
- // The sector number (0 - 17)
- // The numbering goes clockwise and starts at y = 0
- Float_t phi = kRaddeg * TMath::ATan2(pos[0],pos[1]);
- if (phi < 90.0) {
- phi = phi + 270.0;
- }
- else {
- phi = phi - 90.0;
- }
- sec = ((Int_t) (phi / 20.0));
+ // The sector number (0 - 17), according to standard coordinate system
+ cIdPath = gGeoManager->GetPath();
+ cIdSector[0] = cIdPath[21];
+ cIdSector[1] = cIdPath[22];
+ sec = atoi(cIdSector);
// The plane and chamber number
cIdChamber[0] = cIdCurrent[2];
cIdChamber[1] = cIdCurrent[3];
Int_t idChamber = (atoi(cIdChamber) % kNdetsec);
- cha = kNcham - ((Int_t) idChamber / kNplan) - 1;
+ cha = ((Int_t) idChamber / kNplan);
pla = ((Int_t) idChamber % kNplan);
// The detector number
,det
,hits
,qTot
+ ,gMC->TrackTime()*1.0e06
,drRegion);
}