fDetTypeSim = new AliITSDetTypeSim();
SetMarkerColor(kRed);
+ if(!fLoader) MakeLoader(AliConfig::GetDefaultEventFolderName());
+ fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
}
//______________________________________________________________________
// none.
// Return:
// none.
+
if (fHits) {
fHits->Delete();
delete fHits;
//______________________________________________________________________
void AliITS::WriteGeometry(){
- //Writes ITS geomtry on gAlice
+ //Writes ITS geometry on gAlice
if(!fLoader) MakeLoader(AliConfig::GetDefaultEventFolderName());
AliRunLoader* rl = fLoader->GetRunLoader();
// none.
// Return:
// none.
- AliInfoClass("Setting Defaults");
+ AliInfoClass("AliITS::Setting Defaults");
if(!fDetTypeSim) {
Error("SetDefaults()","fDetTypeSim is 0!");
Warning("MakeBranchD","fDetTypeSim is 0!");
return;
}
- fDetTypeSim->SetLoader(fLoader);
+ fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
MakeBranchInTreeD(fLoader->TreeD(),file);
}
if(!fDetTypeSim){
Error("MakeBranchS","fDetTypeSim is 0!");
}
- fDetTypeSim->SetLoader(fLoader);
+ fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
const Char_t *det[3] = {"SPD","SDD","SSD"};
Char_t* digclass;
// none.
// Return:
// none.
-
+
if(!fDetTypeSim) {
Error("SetTreeAddress","fDetTypeSim is 0!");
return;
}
- fDetTypeSim->SetLoader(fLoader);
+ fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
TTree *treeS = fLoader->TreeS();
TTree *treeD = fLoader->TreeD();
fDetTypeSim->SetTreeAddressS(treeS, (Char_t*)GetName());
fDetTypeSim->SetTreeAddressD(treeD, (Char_t*)GetName());
-
-
}
//______________________________________________________________________
void AliITS::AddHit(Int_t track, Int_t *vol, Float_t *hits){
fLoader->LoadHits("read");
fLoader->LoadSDigits("recreate");
AliRunLoader* rl = fLoader->GetRunLoader();
- fDetTypeSim->SetLoader(fLoader);
+ fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
for (Int_t iEvent = 0; iEvent < rl->GetNumberOfEvents(); iEvent++) {
// Do the Hits to Digits operation. Use Standard input values.
// Event number from file, no background hit merging , use size from
return;
}
- fDetTypeSim->SetLoader(fLoader);
+ fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
SetDefaults();
fLoader->LoadHits("read");
Error("HitsToDigits","fDetTypeSim is null!");
return;
}
- fDetTypeSim->SetLoader(fLoader);
+ fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
if(!GetITSgeom()) return; // need transformations to do digitization.
AliITSgeom *geom = GetITSgeom();
return;
}
- fDetTypeSim->SetLoader(fLoader);
+ fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
SetDefaults();
HitsToPreDigits(fLoader->GetRunLoader()->GetEventNumber(),
Error("HitsToPreDigits","fDetTypeSim is null!");
return;
}
- fDetTypeSim->SetLoader(fLoader);
+ fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
if(!GetITSgeom()){
Error("HitsToPreDigits","fGeom is null!");
TBranch* branch = (TBranch*)lTR->Branch("ITSRecPointsF",&ptarray);
branch->SetAddress(&ptarray);
//m.b. : this change is nothing but a nice way to make sure
- //the CPU goes up !
- AliDebug(1,Form("N mod = %d",geom->GetIndexMax()));
+ //the CPU goes up !
for(module=0;module<geom->GetIndexMax();module++){
id = geom->GetModuleType(module);
if (!all && !det[id]) continue;
return;
}
- fDetTypeSim->SetLoader(fLoader);
+ fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
SetDefaults();
fDetTypeSim->SDigitsToDigits(opt,(Char_t*)GetName());
Error("Digits2Raw","fDetTypeSim is 0!");
return;
}
- fDetTypeSim->SetLoader(fLoader);
+ fDetTypeSim->SetLoader((AliITSLoader*)fLoader);
SetDefaults();
fDetTypeSim->GetLoader()->LoadDigits();
TTree* digits = fDetTypeSim->GetLoader()->TreeD();
rawWriter.RawDataSSD(digits->GetBranch("ITSDigitsSSD"));
fLoader->UnloadDigits();
-
-
-
-
}
-
-
-
-
//______________________________________________________________________
AliLoader* AliITS::MakeLoader(const char* topfoldername){
//builds ITSgetter (AliLoader type)
//=================== Hits =========================================
virtual void StepManager() {} // See Step Manager for specific geometry.
//------------ sort hits by module for Digitisation ----------------
- virtual void FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules, Option_t *opt, const char *filename);
-
+ virtual void FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,
+ Option_t *opt, const char *filename);
virtual void InitModules(Int_t size,Int_t &nmodules);
virtual void FillModules(TTree *treeH, Int_t mask = 0);
virtual void ClearModules(){if(fITSmodules) fITSmodules->Delete();}
virtual void ResetDigits(Int_t branch);
virtual void AddSumDigit(AliITSpListItem &sdig);
virtual void AddRealDigit(Int_t branch, Int_t *digits);
-
- virtual void AddSimDigit(Int_t branch, AliITSdigit *d);
+ virtual void AddSimDigit(Int_t branch, AliITSdigit *d);
virtual void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,
Int_t* tracks,Int_t *hits,Float_t* trkcharges);
TObjArray* GetDigits() const {return fDetTypeSim->GetDigits();}
Int_t* GetNDigitArray() const {return fDetTypeSim->GetNDigitArray();}
- TClonesArray *DigitsAddress(Int_t id) { return fDetTypeSim->DigitsAddress(id);}
+ TClonesArray *DigitsAddress(Int_t id) {
+ return fDetTypeSim->DigitsAddress(id);}
//Fast simulation
virtual void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
Option_t *add, Option_t *det, const char *filename);
//----------------------------------------------------------------------
AliITSDetTypeSim::AliITSDetTypeSim():
TObject(),
-fGeom(), //
fSimulation(), // [NDet]
fSegmentation(), // [NDet]
fCalibration(), // [NMod]
fNSDigits(0), //! number of SDigits
fSDigits(), //! [NMod][NSDigits]
fNDigits(0), //! number of Digits
+fRunNumber(0), //! Run number (to access DB)
fDigits(), //! [NMod][NDigits]
fHitClassName(), // String with Hit class name.
fSDigClassName(),// String with SDigit class name.
-fDigClassName(){ // String with digit class name.
+fDigClassName(), // String with digit class name.
+fLoader(0), // local pointer to loader
+fFirstcall(kTRUE){ // flag
// Default Constructor
// Inputs:
// none.
// none.
// Return:
// A properly zero-ed AliITSDetTypeSim class.
- fGeom = 0;
+
fSimulation = new TObjArray(fgkNdettypes);
fSegmentation = new TObjArray(fgkNdettypes);
fSegmentation->SetOwner(kTRUE);
- fCalibration = 0;
- fPreProcess = 0;
- fPostProcess = 0;
- fNSDigits = 0;
fSDigits = new TClonesArray("AliITSpListItem",1000);
fDigits = new TObjArray(fgkNdettypes);
fNDigits = new Int_t[fgkNdettypes];
- fLoader = 0;
fNMod[0] = fgkDefaultNModulesSPD;
fNMod[1] = fgkDefaultNModulesSDD;
fNMod[2] = fgkDefaultNModulesSSD;
SetRunNumber();
- fFirstcall = kTRUE;
}
//----------------------------------------------------------------------
AliITSDetTypeSim::~AliITSDetTypeSim(){
// none.
// Return:
// Nothing.
-
+
if(fSimulation){
- fSimulation->Delete();
- delete fSimulation;
- fSimulation = 0;
+ fSimulation->Delete();
+ delete fSimulation;
}
-
+ fSimulation = 0;
if(fSegmentation){
- fSegmentation->Delete();
- delete fSegmentation;
- fSegmentation = 0;
+ fSegmentation->Delete();
+ delete fSegmentation;
}
-
+ fSegmentation = 0;
if(fCalibration && fRunNumber<0){
- AliITSresponse* rspd = ((AliITSCalibration*)fCalibration->At(fGeom->GetStartSPD()))->GetResponse();
- AliITSresponse* rsdd = ((AliITSCalibration*)fCalibration->At(fGeom->GetStartSDD()))->GetResponse();
- AliITSresponse* rssd = ((AliITSCalibration*)fCalibration->At(fGeom->GetStartSSD()))->GetResponse();
- if(rspd) delete rspd;
- if(rsdd) delete rsdd;
- if(rssd) delete rssd;
- fCalibration->Delete();
- delete fCalibration;
- fCalibration = 0;
+ AliITSresponse* rspd = ((AliITSCalibration*)fCalibration->At(
+ GetITSgeom()->GetStartSPD()))->GetResponse();
+ AliITSresponse* rsdd = ((AliITSCalibration*)fCalibration->At(
+ GetITSgeom()->GetStartSDD()))->GetResponse();
+ AliITSresponse* rssd = ((AliITSCalibration*)fCalibration->At(
+ GetITSgeom()->GetStartSSD()))->GetResponse();
+ if(rspd) delete rspd;
+ if(rsdd) delete rsdd;
+ if(rssd) delete rssd;
+ fCalibration->Delete();
+ delete fCalibration;
}
-
- if(fGeom) delete fGeom;
-
+ fCalibration = 0;
if(fPreProcess){
- fPreProcess->Delete();
- delete fPreProcess;
- fPreProcess = 0;
+ fPreProcess->Delete();
+ delete fPreProcess;
}
-
+ fPreProcess = 0;
if(fPostProcess){
- fPostProcess->Delete();
- delete fPostProcess;
- fPostProcess = 0;
+ fPostProcess->Delete();
+ delete fPostProcess;
}
-
+ fPostProcess = 0;
if(fNDigits) delete [] fNDigits;
-
- if (fLoader)
- {
- fLoader->GetModulesFolder()->Remove(this);
- }
-
+ fNDigits = 0;
+ if (fLoader)fLoader->GetModulesFolder()->Remove(this);
+ fLoader = 0; // Not deleting it.
if (fSDigits) {
- fSDigits->Delete();
- delete fSDigits;
- fSDigits=0;
+ fSDigits->Delete();
+ delete fSDigits;
}
+ fSDigits=0;
if (fDigits) {
fDigits->Delete();
delete fDigits;
- fDigits=0;
}
-
+ fDigits=0;
}
//----------------------------------------------------------------------
AliITSDetTypeSim::AliITSDetTypeSim(const AliITSDetTypeSim &source) : TObject(source){
// Copy Constructor for object AliITSDetTypeSim not allowed
- if(this==&source) return;
- Error("Copy constructor",
- "You are not allowed to make a copy of the AliITSDetTypeSim");
- exit(1);
-
+ if(this==&source) return;
+ Error("Copy constructor",
+ "You are not allowed to make a copy of the AliITSDetTypeSim");
+ exit(1);
}
//----------------------------------------------------------------------
AliITSDetTypeSim& AliITSDetTypeSim::operator=(const AliITSDetTypeSim &source){
// The = operator for object AliITSDetTypeSim
if(&source==this) return *this;
- Error("operator=","You are not allowed to make a copy of the AliITSDetTypeSIm");
+ Error("operator=",
+ "You are not allowed to make a copy of the AliITSDetTypeSIm");
exit(1);
return *this;
}
-
+//______________________________________________________________________
+void AliITSDetTypeSim::SetITSgeom(AliITSgeom *geom){
+ // Sets/replaces the existing AliITSgeom object kept in AliITSLoader
+ //
+ // Inputs:
+ // AliITSgoem *geom The AliITSgeom object to be used.
+ // Output:
+ // none.
+ // Return:
+ // none.
+ if(!fLoader){
+ Error("SetITSgeom","No pointer to loader - nothing done");
+ return;
+ }
+ else {
+ fLoader->SetITSgeom(geom); // protections in AliITSLoader::SetITSgeom
+ }
+
+}
+//______________________________________________________________________
+void AliITSDetTypeSim::SetLoader(AliITSLoader *loader){
+ // Sets the local copy of the AliITSLoader, and passes on the
+ // AliITSgeom object as needed.
+ // Inputs
+ // AliITSLoader *loader pointer to AliITSLoader for local use
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+
+ if(fLoader==loader) return; // Same do nothing
+ if(fLoader){ // alread have an existing loader
+ Error("SetLoader",
+ "Already have an exisiting loader ptr=%p Nothing done",
+ fLoader);
+ } // end if
+ fLoader = loader;
+}
//______________________________________________________________________
void AliITSDetTypeSim::SetSimulationModel(Int_t dettype,AliITSsimulation *sim){
AliITSsimulation* AliITSDetTypeSim::GetSimulationModelByModule(Int_t module){
//Get simulation model by module number
- if(fGeom==0) {
- Warning("GetSimulationModelByModule","fGeom is 0!");
+ if(GetITSgeom()==0) {
+ Warning("GetSimulationModelByModule","GetITSgeom() is 0!");
return 0;
}
- return GetSimulationModel(fGeom->GetModuleType(module));
+ return GetSimulationModel(GetITSgeom()->GetModuleType(module));
}
//_______________________________________________________________________
void AliITSDetTypeSim::SetDefaultSegmentation(Int_t idet){
- // Set default segmentation model objects
- AliITSsegmentation *seg;
- if(fSegmentation==0x0){
- fSegmentation = new TObjArray(fgkNdettypes);
- fSegmentation->SetOwner(kTRUE);
- }
- if(GetSegmentationModel(idet))delete (AliITSsegmentation*)fSegmentation->At(idet);
- if(idet==0){
- seg = new AliITSsegmentationSPD(fGeom);
- }
- else if(idet==1){
- AliITSCalibration* res = GetCalibrationModel(fGeom->GetStartSDD());
- seg = new AliITSsegmentationSDD(fGeom,res);
- }
- else {
- seg = new AliITSsegmentationSSD(fGeom);
- }
- SetSegmentationModel(idet,seg);
-}
+ // Set default segmentation model objects
+ AliITSsegmentation *seg;
+ if(fSegmentation==0x0){
+ fSegmentation = new TObjArray(fgkNdettypes);
+ fSegmentation->SetOwner(kTRUE);
+ }
+ if(GetSegmentationModel(idet))
+ delete (AliITSsegmentation*)fSegmentation->At(idet);
+ if(idet==0){
+ seg = new AliITSsegmentationSPD(GetITSgeom());
+ }else if(idet==1){
+ AliITSCalibration* res=GetCalibrationModel(
+ GetITSgeom()->GetStartSDD());
+ seg = new AliITSsegmentationSDD(GetITSgeom(),res);
+ }else {
+ seg = new AliITSsegmentationSSD(GetITSgeom());
+ }
+ SetSegmentationModel(idet,seg);
+}
//______________________________________________________________________
-void AliITSDetTypeSim::SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg){
+void AliITSDetTypeSim::SetSegmentationModel(Int_t dettype,
+ AliITSsegmentation *seg){
//Set segmentation model for detector type
if(fSegmentation==0x0){
fSegmentation->SetOwner(kTRUE);
}
fSegmentation->AddAt(seg,dettype);
-
}
//______________________________________________________________________
AliITSsegmentation* AliITSDetTypeSim::GetSegmentationModel(Int_t dettype){
-
//Get segmentation model for detector type
if(fSegmentation==0) {
- Warning("GetSegmentationModel","fSegmentation is 0!");
- return 0;
+ Warning("GetSegmentationModel","fSegmentation is 0!");
+ return 0;
}
return (AliITSsegmentation*)(fSegmentation->At(dettype));
-
}
//_______________________________________________________________________
AliITSsegmentation* AliITSDetTypeSim::GetSegmentationModelByModule(Int_t module){
-
- //Get segmentation model by module number
- if(fGeom==0){
- Warning("GetSegmentationModelByModule","fGeom is 0!");
- return 0;
- }
- return GetSegmentationModel(fGeom->GetModuleType(module));
-
+ //Get segmentation model by module number
+ if(GetITSgeom()==0){
+ Warning("GetSegmentationModelByModule","GetITSgeom() is 0!");
+ return 0;
+ }
+ return GetSegmentationModel(GetITSgeom()->GetModuleType(module));
}
//_______________________________________________________________________
void AliITSDetTypeSim::CreateCalibrationArray() {
+ //Create the container of calibration functions with correct size
+ if (fCalibration) {
+ Warning("CreateCalibration","pointer to calibration object exists\n");
+ fCalibration->Delete();
+ delete fCalibration;
+ }
- //Create the container of calibration functions with correct size
- if (fCalibration) {
- Warning("CreateCalibration","pointer to calibration object exists\n");
- fCalibration->Delete();
- delete fCalibration;
- }
-
- Int_t nModTot = fGeom->GetIndexMax();
- fCalibration = new TObjArray(nModTot);
- fCalibration->SetOwner(kTRUE);
- fCalibration->Clear();
-
+ Int_t nModTot = GetITSgeom()->GetIndexMax();
+ fCalibration = new TObjArray(nModTot);
+ fCalibration->SetOwner(kTRUE);
+ fCalibration->Clear();
}
//_______________________________________________________________________
void AliITSDetTypeSim::SetCalibrationModel(Int_t iMod, AliITSCalibration *resp){
+ //Set response model for modules
- //Set response model for modules
-
- if (fCalibration==0) CreateCalibrationArray();
+ if (fCalibration==0) CreateCalibrationArray();
- if (fCalibration->At(iMod)!=0)
- delete (AliITSCalibration*) fCalibration->At(iMod);
- fCalibration->AddAt(resp, iMod);
-
+ if (fCalibration->At(iMod)!=0)
+ delete (AliITSCalibration*) fCalibration->At(iMod);
+ fCalibration->AddAt(resp, iMod);
}
-
//______________________________________________________________________
void AliITSDetTypeSim::ResetCalibrationArray(){
-
- //resets response array
- if(fCalibration && fRunNumber<0){ // if fRunNumber<0 fCalibration is owner
- AliITSresponse* rspd = ((AliITSCalibration*)fCalibration->At(fGeom->GetStartSPD()))->GetResponse();
- AliITSresponse* rsdd = ((AliITSCalibration*)fCalibration->At(fGeom->GetStartSDD()))->GetResponse();
- AliITSresponse* rssd = ((AliITSCalibration*)fCalibration->At(fGeom->GetStartSSD()))->GetResponse();
- if(rspd) delete rspd;
- if(rsdd) delete rsdd;
- if(rssd) delete rssd;
- fCalibration->Clear();
- }
- else if (fCalibration && fRunNumber>=0){
- fCalibration->Clear();
- }
+ //resets response array
+ if(fCalibration && fRunNumber<0){ // if fRunNumber<0 fCalibration is owner
+ AliITSresponse* rspd = ((AliITSCalibration*)fCalibration->At(
+ GetITSgeom()->GetStartSPD()))->GetResponse();
+ AliITSresponse* rsdd = ((AliITSCalibration*)fCalibration->At(
+ GetITSgeom()->GetStartSDD()))->GetResponse();
+ AliITSresponse* rssd = ((AliITSCalibration*)fCalibration->At(
+ GetITSgeom()->GetStartSSD()))->GetResponse();
+ if(rspd) delete rspd;
+ if(rsdd) delete rsdd;
+ if(rssd) delete rssd;
+ fCalibration->Clear();
+ }else if (fCalibration && fRunNumber>=0){
+ fCalibration->Clear();
+ }
}
//______________________________________________________________________
void AliITSDetTypeSim::ResetSegmentation(){
-
- //Resets segmentation array
- if(fSegmentation) fSegmentation->Clear();
+ //Resets segmentation array
+ if(fSegmentation) fSegmentation->Clear();
}
-
//_______________________________________________________________________
AliITSCalibration* AliITSDetTypeSim::GetCalibrationModel(Int_t iMod){
- //Get response model for module number iMod
+ //Get response model for module number iMod
- if(fCalibration==0) {
- AliError("fCalibration is 0!");
- return 0;
- }
-
+ if(fCalibration==0) {
+ AliError("fCalibration is 0!");
+ return 0;
+ }
return (AliITSCalibration*)(fCalibration->At(iMod));
-
}
//_______________________________________________________________________
void AliITSDetTypeSim::SetDefaults(){
-
- //Set defaults for segmentation and response
-
- if(fGeom==0){
- Warning("SetDefaults","fGeom is 0!");
- return;
- }
- if (fCalibration==0) {
- CreateCalibrationArray();
- }
-
- ResetSegmentation();
- if(!GetCalibration()){AliFatal("Exit"); exit(0);}
-
- for(Int_t idet=0;idet<fgkNdettypes;idet++){
- //SPD
- if(idet==0){
- if(!GetSegmentationModel(idet)) SetDefaultSegmentation(idet);
- const char *kData0=(GetCalibrationModel(fGeom->GetStartSPD()))->DataType();
- if (strstr(kData0,"real")) {
- SetDigitClassName(idet,"AliITSdigit");
- }
- else {
- SetDigitClassName(idet,"AliITSdigitSPD");
- }
- }
- //SDD
- if(idet==1){
- if(!GetSegmentationModel(idet)) SetDefaultSegmentation(idet);
- AliITSCalibrationSDD* rsp = (AliITSCalibrationSDD*)GetCalibrationModel(fGeom->GetStartSDD());
- const char *kopt = ((AliITSresponseSDD*)rsp->GetResponse())->ZeroSuppOption();
- if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D"))) {
- SetDigitClassName(idet,"AliITSdigit");
- }
- else {
- SetDigitClassName(idet,"AliITSdigitSDD");
- }
-
- }
- //SSD
- if(idet==2){
- if(!GetSegmentationModel(idet))SetDefaultSegmentation(idet);
-
- const char *kData2 = (GetCalibrationModel(fGeom->GetStartSSD())->DataType());
- if (strstr(kData2,"real")) {
- SetDigitClassName(idet,"AliITSdigit");
- }
- else {
- SetDigitClassName(idet,"AliITSdigitSSD");
- }
- }
- }
+ //Set defaults for segmentation and response
+
+ if(GetITSgeom()==0){
+ Warning("SetDefaults","GetITSgeom() is 0!");
+ return;
+ } // end if
+ if (fCalibration==0) {
+ CreateCalibrationArray();
+ } // end if
+
+ ResetSegmentation();
+ if(!GetCalibration()){AliFatal("Exit"); exit(0);}
+
+ for(Int_t idet=0;idet<fgkNdettypes;idet++){
+ //SPD
+ if(idet==0){
+ if(!GetSegmentationModel(idet)) SetDefaultSegmentation(idet);
+ const char *kData0=(GetCalibrationModel(GetITSgeom()->GetStartSPD()))->DataType();
+ if (strstr(kData0,"real")) {
+ SetDigitClassName(idet,"AliITSdigit");
+ }else {
+ SetDigitClassName(idet,"AliITSdigitSPD");
+ } // end if
+ } // end if idet==0
+ //SDD
+ if(idet==1){
+ if(!GetSegmentationModel(idet)) SetDefaultSegmentation(idet);
+ AliITSCalibrationSDD* rsp =
+ (AliITSCalibrationSDD*)GetCalibrationModel(
+ GetITSgeom()->GetStartSDD());
+ const char *kopt = ((AliITSresponseSDD*)rsp->GetResponse())->
+ ZeroSuppOption();
+ if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D"))) {
+ SetDigitClassName(idet,"AliITSdigit");
+ }else {
+ SetDigitClassName(idet,"AliITSdigitSDD");
+ } // end if
+ } // end if idet==1
+ //SSD
+ if(idet==2){
+ if(!GetSegmentationModel(idet))SetDefaultSegmentation(idet);
+ const char *kData2 = (GetCalibrationModel(
+ GetITSgeom()->GetStartSSD())->DataType());
+ if (strstr(kData2,"real")) {
+ SetDigitClassName(idet,"AliITSdigit");
+ }else {
+ SetDigitClassName(idet,"AliITSdigitSSD");
+ } // end if
+ } // end if idet==2
+ }// end for idet
}
-
//______________________________________________________________________
Bool_t AliITSDetTypeSim::GetCalibration() {
// Get Default calibration if a storage is not defined.
Int_t iMod = i + fNMod[0] + fNMod[1];
SetCalibrationModel(iMod, cal);
}
-
return kTRUE;
}
-
-
-
//_______________________________________________________________________
void AliITSDetTypeSim::SetDefaultSimulation(){
-
//Set default simulation for detector type
- if(fGeom==0){
- Warning("SetDefaultSimulation","fGeom is 0!");
+ if(GetITSgeom()==0){
+ Warning("SetDefaultSimulation","GetITSgeom() is 0!");
return;
}
if(fCalibration==0){
if(fSegmentation==0){
Warning("SetDefaultSimulation","fSegmentation is 0!");
for(Int_t i=0;i<fgkNdettypes;i++) SetDefaultSegmentation(i);
- }
- else{
- for(Int_t i=0;i<fgkNdettypes;i++){
- if(!GetSegmentationModel(i)){
- Warning("SetDefaultSimulation","Segmentation not defined for det %d - Default taken\n!",i);
- SetDefaultSegmentation(i);
- }
- }
+ }else for(Int_t i=0;i<fgkNdettypes;i++) if(!GetSegmentationModel(i)){
+ Warning("SetDefaultSimulation",
+ "Segmentation not defined for det %d - Default taken\n!",i);
+ SetDefaultSegmentation(i);
}
AliITSsimulation* sim;
for(Int_t idet=0;idet<fgkNdettypes;idet++){
//SPD
if(idet==0){
- sim = GetSimulationModel(idet);
-
+ sim = GetSimulationModel(idet);
if(!sim){
sim = new AliITSsimulationSPD(this);
SetSimulationModel(idet,sim);
if(!sim){
sim = new AliITSsimulationSDD(this);
SetSimulationModel(idet,sim);
- }
-
+ }
}
//SSD
if(idet==2){
sim = new AliITSsimulationSSD(this);
SetSimulationModel(idet,sim);
}
-
}
}
}
-
-
-
-
//___________________________________________________________________
void AliITSDetTypeSim::SetTreeAddressS(TTree* treeS, Char_t* name){
- // Set branch address for the ITS summable digits Trees.
-
+ // Set branch address for the ITS summable digits Trees.
char branchname[30];
if(!treeS){
}
//___________________________________________________________________
void AliITSDetTypeSim::ResetDigits(){
- // Reset number of digits and the digits array for the ITS detector.
-
+ // Reset number of digits and the digits array for the ITS detector.
if(!fDigits){
Error("ResetDigits","fDigits is null!");
//_______________________________________________________________________
void AliITSDetTypeSim::SDigitsToDigits(Option_t* opt, Char_t* name){
// Standard Summable digits to Digits function.
- if(!fGeom){
- Warning("SDigitsToDigits","fGeom is null!!");
+ if(!GetITSgeom()){
+ Warning("SDigitsToDigits","GetITSgeom() is null!!");
return;
}
TBranch* brchSDigits = trees->GetBranch(name);
Int_t id;
- for(Int_t module=0;module<fGeom->GetIndexMax();module++){
- id = fGeom->GetModuleType(module);
+ for(Int_t module=0;module<GetITSgeom()->GetIndexMax();module++){
+ id = GetITSgeom()->GetModuleType(module);
if (!all && !det[id]) continue;
sim = (AliITSsimulation*)GetSimulationModel(id);
- printf("module=%d name=%s\n",module,sim->ClassName());
if(!sim){
Error("SDigit2Digits","The simulation class was not "
"instanciated for module %d type %s!",module,
- fGeom->GetModuleTypeName(module));
+ GetITSgeom()->GetModuleTypeName(module));
exit(1);
}
sim->InitSimulationModule(module,gAlice->GetEvNumber());
fLoader->TreeD()->AutoSave();
fLoader->TreeD()->Reset();
}
-
-
-
//_________________________________________________________
-void AliITSDetTypeSim::AddSumDigit(AliITSpListItem &sdig){
-
+void AliITSDetTypeSim::AddSumDigit(AliITSpListItem &sdig){
//Adds the module full of summable digits to the summable digits tree.
+
TClonesArray &lsdig = *fSDigits;
new(lsdig[fNSDigits++]) AliITSpListItem(sdig);
}
//__________________________________________________________
void AliITSDetTypeSim::AddRealDigit(Int_t branch, Int_t *digits){
// Add a real digit - as coming from data.
+
TClonesArray &ldigits = *((TClonesArray*)fDigits->At(branch));
new(ldigits[fNDigits[branch]++]) AliITSdigit(digits);
}
//__________________________________________________________
-void AliITSDetTypeSim::AddSimDigit(Int_t branch, AliITSdigit* d){
-
+void AliITSDetTypeSim::AddSimDigit(Int_t branch, AliITSdigit* d){
// Add a simulated digit.
+
TClonesArray &ldigits = *((TClonesArray*)fDigits->At(branch));
switch(branch){
case 0:
case 2:
new(ldigits[fNDigits[branch]++]) AliITSdigitSSD(*((AliITSdigitSSD*)d));
break;
- }
-
+ }
}
-
//______________________________________________________________________
void AliITSDetTypeSim::AddSimDigit(Int_t branch,Float_t phys,Int_t *digits,
Int_t *tracks,Int_t *hits,Float_t *charges){
new(ldigits[fNDigits[branch]++]) AliITSdigitSPD(digits,tracks,hits);
break;
case 1:
- resp = (AliITSCalibrationSDD*)GetCalibrationModel(fGeom->GetStartSDD());
+ resp = (AliITSCalibrationSDD*)GetCalibrationModel(
+ GetITSgeom()->GetStartSDD());
new(ldigits[fNDigits[branch]++]) AliITSdigitSDD(phys,digits,tracks,
hits,charges,resp);
break;
break;
}
}
-
-
-
//______________________________________________________________________
-void AliITSDetTypeSim::StoreCalibration(Int_t firstRun, Int_t lastRun, AliCDBMetaData &md) {
-
+void AliITSDetTypeSim::StoreCalibration(Int_t firstRun, Int_t lastRun,
+ AliCDBMetaData &md) {
// Store calibration in the calibration database
-
// The database must be created in an external piece of code (i.e.
// a configuration macro )
AliCDBManager::Instance()->Put(&respSPD, idRespSPD, &md);
AliCDBManager::Instance()->Put(&respSDD, idRespSDD, &md);
AliCDBManager::Instance()->Put(&respSSD, idRespSSD, &md);
-
-
-
}
#include <TObjArray.h>
#include <TClonesArray.h>
#include "AliITSCalibration.h"
+#include "AliITSLoader.h"
#include "AliITSgeom.h"
class TTree;
class AliITSsimulation;
class AliITSsegmentation;
class AliITSresponse;
-class AliLoader;
class AliITSDetTypeSim : public TObject {
public:
virtual ~AliITSDetTypeSim();
AliITSDetTypeSim(const AliITSDetTypeSim &source);
AliITSDetTypeSim& operator=(const AliITSDetTypeSim &source);
- AliITSgeom *GetITSgeom() const {return fGeom;}
- void SetITSgeom(AliITSgeom *geom){fGeom=geom;}
+ AliITSgeom *GetITSgeom() const {
+ if(fLoader)return ((AliITSLoader*)fLoader)->GetITSgeom();
+ else return 0;}
+ void SetITSgeom(AliITSgeom *geom);
virtual void SetSimulationModel(Int_t dettype,AliITSsimulation *sim);
virtual AliITSsimulation* GetSimulationModel(Int_t dettype);
virtual void SetCalibrationModel(Int_t iMod,AliITSCalibration *resp);
virtual AliITSCalibration* GetCalibrationModel(Int_t iMod);
- virtual AliITSresponse* GetResponse(Int_t dettype) {return GetCalibrationModel(GetITSgeom()->GetStartDet(dettype))->GetResponse();}
-
+ virtual AliITSresponse* GetResponse(Int_t dettype) {
+ return GetCalibrationModel(
+ GetITSgeom()->GetStartDet(dettype))->GetResponse();}
TObjArray* GetCalibrationArray() const {return fCalibration;}
TObjArray* GetSegmentation() const {return fSegmentation;}
void ResetCalibrationArray();
void ResetSegmentation();
- virtual void SetLoader(AliLoader* loader) {fLoader=loader;}
- AliLoader* GetLoader() const {return fLoader;}
+ virtual void SetLoader(AliITSLoader* loader);
+ AliITSLoader* GetLoader() const {return fLoader;}
virtual void SetDefaults();
virtual void SetDefaultSimulation();
TClonesArray* GetSDigits() const {return fSDigits;}
TObjArray* GetDigits() const {return fDigits;}
Int_t* GetNDigitArray() const {return fNDigits;}
- TClonesArray *DigitsAddress(Int_t id) const { return ((TClonesArray*)(*fDigits)[id]);}
-
+ TClonesArray *DigitsAddress(Int_t id) const {
+ return ((TClonesArray*)(*fDigits)[id]);}
virtual void ResetSDigits(){fNSDigits=0;if(fSDigits!=0) fSDigits->Clear();}
virtual void ResetDigits();
virtual void ResetDigits(Int_t branch);
virtual void AddSimDigit(Int_t branch, AliITSdigit *d);
virtual void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,
Int_t* tracks,Int_t *hits,Float_t* trkcharges);
-
- virtual void SetDigitClassName(Int_t i, Char_t* name) {fDigClassName[i]=name;}
+ virtual void SetDigitClassName(Int_t i, Char_t* name) {
+ fDigClassName[i]=name;}
Char_t* GetDigitClassName(Int_t i) const {return fDigClassName[i];}
-
void StoreCalibration(Int_t firstRun, Int_t lastRun, AliCDBMetaData &md);
protected:
-
virtual void CreateCalibrationArray();
virtual Bool_t GetCalibration();
private:
-
void SetDefaultSegmentation(Int_t idet); // creates def segm.
static const Int_t fgkNdettypes; // number of different det. types
static const Int_t fgkDefaultNModulesSPD; // Total numbers of SPD modules by default
static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules by default
Int_t fNMod[3]; // numbers of modules from different types
- AliITSgeom *fGeom; // pointer to ITS geom
TObjArray *fSimulation; //! [NDet]
TObjArray *fSegmentation; //! [NDet]
TObjArray *fCalibration; //! [NMod]
Int_t fNSDigits; //! number of SDigits
TClonesArray *fSDigits; //! [NMod][NSDigits]
Int_t* fNDigits; //! [NDet] number of Digits for det.
- Int_t fRunNumber; //! run number (to access DB)
- TObjArray *fDigits; //! [NMod][NDigits]
+ Int_t fRunNumber; //! run number (to access DB)
+ TObjArray *fDigits; //! [NMod][NDigits]
TString fHitClassName; //! String with Hit class name
TString fSDigClassName;//! String with SDigit class name.
Char_t* fDigClassName[3]; //! String with digit class name.
- AliLoader* fLoader; //! loader
- Bool_t fFirstcall; //! flag
+ AliITSLoader* fLoader; //! loader
+ Bool_t fFirstcall; //! flag
- ClassDef(AliITSDetTypeSim,4) // ITS Simulation structure
+ ClassDef(AliITSDetTypeSim,5) // ITS Simulation structure
};
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Id$
+*/
+#include <TArrayD.h>
+#include <TArrayF.h>
+#include <TStopwatch.h>
+#include <AliITSgeomSPD.h>
+#include <AliITSgeomSDD.h>
+#include <AliITSgeomSSD.h>
+#include <AliITSsegmentationSPD.h>
+#include <AliITSsegmentationSDD.h>
+#include <AliITSsegmentationSSD.h>
+#include <TGeoManager.h>
+#include <TGeoVolume.h>
+#include <TGeoShape.h>
+#include <TGeoBBox.h>
+#include <TGeoTrd1.h>
+#include <TGeoTrd2.h>
+#include <TGeoArb8.h>
+#include <TGeoTube.h>
+#include <TGeoCone.h>
+#include <TGeoSphere.h>
+#include <TGeoPara.h>
+#include <TGeoPgon.h>
+#include <TGeoPcon.h>
+#include <TGeoEltu.h>
+#include <TGeoHype.h>
+#include <TClass.h>
+
+#include <AliLog.h>
+#include "AliITSgeom.h"
+#include "AliITSInitGeometry.h"
+
+ClassImp(AliITSInitGeometry)
+//______________________________________________________________________
+AliITSInitGeometry::AliITSInitGeometry():
+TObject(),
+fName(),
+fMinorVersion(0),
+fMajorVersion(0),
+fTiming(kFALSE),
+fSegGeom(kFALSE),
+fDecode(kFALSE){
+ // Default Creator
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // A default inilized AliITSInitGeometry object
+}
+//______________________________________________________________________
+AliITSInitGeometry::AliITSInitGeometry(const Char_t *name,Int_t minorversion):
+TObject(),
+fName(name),
+fMinorVersion(minorversion),
+fMajorVersion(0),
+fTiming(kFALSE),
+fSegGeom(kFALSE),
+fDecode(kFALSE){
+ // Default Creator
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // A default inilized AliITSInitGeometry object
+
+ if(fName.CompareTo("AliITSvPPRasymmFMD")==0)if(fMinorVersion==1||
+ fMinorVersion==2){
+ fMajorVersion=10;
+ return;
+ } // end if
+ // if not defined geometry error
+ Error("AliITSInitGeometry(name,version)"," Name must be AliITSvPPRasymmFMD"
+ " and version must be 1 or 2 for now.");
+ fMinorVersion = 0;
+ fName = "";
+ return;
+}
+//______________________________________________________________________
+AliITSgeom* AliITSInitGeometry::CreateAliITSgeom(){
+ // Creates and Initilizes the geometry transformation class AliITSgeom
+ // to values appropreate to this specific geometry. Now that
+ // the segmentation is part of AliITSgeom, the detector
+ // segmentations are also defined here.
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // A pointer to a new properly inilized AliITSgeom class. If
+ // pointer = 0 then failed to init.
+
+ AliITSgeom *geom = new AliITSgeom();
+ if(!InitAliITSgeom(geom)){ // Error initilization failed
+ delete geom;
+ geom = 0;
+ } // end if
+ return geom;
+}
+//______________________________________________________________________
+Bool_t AliITSInitGeometry::InitAliITSgeom(AliITSgeom *geom){
+ // Initilizes the geometry transformation class AliITSgeom
+ // to values appropreate to this specific geometry. Now that
+ // the segmentation is part of AliITSgeom, the detector
+ // segmentations are also defined here.
+ // Inputs:
+ // AliITSgeom *geom A pointer to the AliITSgeom class
+ // Outputs:
+ // AliITSgeom *geom This pointer recreated and properly inilized.
+ // Return:
+ // none.
+
+ switch(fMajorVersion){
+ case 10:{ // only case defined so far
+ return InitAliITSgeomPPRasymmFMD(geom);
+ }break; // end case
+ default:{
+ Error("InitAliITSgeom","Undefine geomtery");
+ return kFALSE;
+ } break; // end case
+ } // end switch
+ return kFALSE;
+}
+//______________________________________________________________________
+Bool_t AliITSInitGeometry::InitAliITSgeomPPRasymmFMD(AliITSgeom *geom){
+ // Initilizes the geometry transformation class AliITSgeom
+ // to values appropreate to this specific geometry. Now that
+ // the segmentation is part of AliITSgeom, the detector
+ // segmentations are also defined here.
+ // Inputs:
+ // AliITSgeom *geom A pointer to the AliITSgeom class
+ // Outputs:
+ // AliITSgeom *geom This pointer recreated and properly inilized.
+ // Return:
+ // none.
+ // const Double_t kcm2micron = 1.0E4;
+ const Int_t kItype=0; // Type of transormation defined 0=> Geant
+ const Int_t klayers = 6; // number of layers in the ITS
+ const Int_t kladders[klayers] = {20,40,14,22,34,38}; // Number of ladders
+ const Int_t kdetectors[klayers] = {4,4,6,8,22,25};// number of detector/lad
+ const AliITSDetector idet[6] = {kSPD,kSPD,kSDD,kSDD,kSSD,kSSD};
+ const TString pathbase = "/ALIC_1/ITSV_1/ITSD_1/";
+ const TString names[2][klayers] = {
+ {"%sIT12_1/I12A_%d/I10A_%d/I103_%d/I101_1/ITS1_1", // lay=1
+ "%sIT12_1/I12A_%d/I20A_%d/I1D3_%d/I1D1_1/ITS2_1", // lay=2
+ "%sIT34_1/I004_%d/I302_%d/ITS3_%d/", // lay=3
+ "%sIT34_1/I005_%d/I402_%d/ITS4_%d/", // lay=4
+ "%sIT56_1/I565_%d/I562_%d/ITS5_%d/", // lay=5
+ "%sIT56_1/I569_%d/I566_%d/ITS6_%d/"},// lay=6
+ {"%sIT12_1/I12B_%d/I10B_%d/I107_%d/I101_1/ITS1_1", // lay=1
+ "%sIT12_1/I12B_%d/I20B_%d/I1D7_%d/I1D1_1/ITS2_1", // lay=2
+ "%sIT34_1/I004_%d/I302_%d/ITS3_%d", // lay=3
+ "%sIT34_1/I005_%d/I402_%d/ITS4_%d", // lay=4
+ "%sIT56_1/I565_%d/I562_%d/ITS5_%d", // lay=5
+ "%sIT56_1/I569_%d/I566_%d/ITS6_%d"}};// Lay=6
+ /*
+ Int_t itsGeomTreeCopys[knlayers][3]= {{10, 2, 4},// lay=1
+ {10, 4, 4},// lay=2
+ {14, 6, 1},// lay=3
+ {22, 8, 1},// lay=4
+ {34,22, 1},// lay=5
+ {38,25, 1}};//lay=6
+ */
+ Int_t mod,nmods=0,lay,lad,det,cpn0,cpn1,cpn2;
+ Double_t tran[3]={0.0,0.0,0.0},rot[10]={9*0.0,1.0};
+ TArrayD shapePar;
+ TString path,shapeName;
+ TGeoHMatrix materix;
+ Bool_t initSeg[3]={kFALSE,kFALSE,kFALSE};
+ TStopwatch *time;if(fTiming) time=new TStopwatch();
+
+ if(fTiming) time->Start();
+ for(mod=0;mod<klayers;mod++) nmods += kladders[mod]*kdetectors[mod];
+ geom->Init(kItype,klayers,kladders,kdetectors,nmods);
+ for(mod=0;mod<nmods;mod++){
+ DecodeDetectorLayers(mod,lay,lad,det); // Write
+ geom->CreateMatrix(mod,lay,lad,det,idet[lay-1],tran,rot);
+ RecodeDetector(mod,cpn0,cpn1,cpn2); // Write reusing lay,lad,det.
+ path.Form(names[fMinorVersion-1][lay-1].Data(),
+ pathbase.Data(),cpn0,cpn1,cpn2);
+ geom->GetGeomMatrix(mod)->SetPath(path);
+ GetTransformation(path.Data(),materix);
+ geom->SetTrans(mod,materix.GetTranslation());
+ geom->SetRotMatrix(mod,materix.GetRotationMatrix());
+ if(initSeg[idet[lay-1]]) continue;
+ GetShape(path,shapeName,shapePar);
+ if(shapeName.CompareTo("BOX")){
+ Error("InitITSgeom","Geometry changed without proper code update"
+ "or error in reading geometry. Shape is not BOX.");
+ return kFALSE;
+ } // end if
+ InitGeomShapePPRasymmFMD(idet[lay-1],initSeg,shapePar,geom);
+ } // end for module
+ if(fTiming){
+ time->Stop();
+ time->Print();
+ delete time;
+ } // end if
+ return kTRUE;
+}
+//______________________________________________________________________
+Bool_t AliITSInitGeometry::InitGeomShapePPRasymmFMD(AliITSDetector idet,
+ Bool_t *initSeg,
+ TArrayD &shapePar,
+ AliITSgeom *geom){
+ // Initilizes the geometry segmentation class AliITSgeomS?D, or
+ // AliITSsegmentationS?D depending on the vaule of fSegGeom,
+ // to values appropreate to this specific geometry. Now that
+ // the segmentation is part of AliITSgeom, the detector
+ // segmentations are also defined here.
+ // Inputs:
+ // Int_t lay The layer number/name.
+ // AliITSgeom *geom A pointer to the AliITSgeom class
+ // Outputs:
+ // AliITSgeom *geom This pointer recreated and properly inilized.
+ // Return:
+ // none.
+ // const Double_t kcm2micron = 1.0E4;
+ const Double_t kmicron2cm = 1.0E-4;
+ Int_t i;
+ TArrayF shapeParF;
+
+ shapeParF.Set(shapePar.GetSize());
+ for(i=0;i<shapePar.GetSize();i++) shapeParF[i]=shapePar[i];
+ switch (idet){
+ case kSPD:{
+ initSeg[idet] = kTRUE;
+ AliITSgeomSPD *geomSPD = new AliITSgeomSPD425Short();
+ Float_t bx[256],bz[280];
+ for(i=000;i<256;i++) bx[i] = 50.0*kmicron2cm; // in x all are 50 microns.
+ for(i=000;i<160;i++) bz[i] = 425.0*kmicron2cm; // most are 425 microns
+ // except below
+ for(i=160;i<280;i++) bz[i] = 0.0*kmicron2cm; // Outside of detector.
+ bz[ 31] = bz[ 32] = 625.0*kmicron2cm; // first chip boundry
+ bz[ 63] = bz[ 64] = 625.0*kmicron2cm; // first chip boundry
+ bz[ 95] = bz[ 96] = 625.0*kmicron2cm; // first chip boundry
+ bz[127] = bz[128] = 625.0*kmicron2cm; // first chip boundry
+ bz[160] = 425.0*kmicron2cm;// Set so that there is no zero pixel size for fNz.
+ geomSPD->ReSetBins(shapeParF[1],256,bx,160,bz);
+ geom->ReSetShape(idet,geomSPD);
+ }break;
+ case kSDD:{
+ initSeg[idet] = kTRUE;
+ AliITSgeomSDD *geomSDD = new AliITSgeomSDD256(shapeParF.GetSize(),
+ shapeParF.GetArray());
+ geom->ReSetShape(idet,geomSDD);
+ }break;
+ case kSSD:{
+ initSeg[idet] = kTRUE;
+ AliITSgeomSSD *geomSSD = new AliITSgeomSSD275and75(
+ shapeParF.GetSize(),shapeParF.GetArray());
+ geom->ReSetShape(idet,geomSSD);
+ }break;
+ default:{// Others, Note no kSDDp or kSSDp in this geometry.
+ geom->ReSetShape(idet,0);
+ Info("InitGeomShapePPRasymmFMD",
+ "default Dx=%f Dy=%f Dz=%f default=%d",
+ shapePar[0],shapePar[1],shapePar[2],idet);
+ }break;
+ } // end switch
+ return kTRUE;
+}
+//______________________________________________________________________
+Bool_t AliITSInitGeometry::InitSegmentationPPRasymmFMD(AliITSDetector idet,
+ Bool_t *initSeg,
+ TArrayD &shapePar,
+ AliITSgeom *geom){
+ // Initilizes the geometry segmentation class AliITSgeomS?D, or
+ // AliITSsegmentationS?D depending on the vaule of fSegGeom,
+ // to values appropreate to this specific geometry. Now that
+ // the segmentation is part of AliITSgeom, the detector
+ // segmentations are also defined here.
+ // Inputs:
+ // Int_t lay The layer number/name.
+ // AliITSgeom *geom A pointer to the AliITSgeom class
+ // Outputs:
+ // AliITSgeom *geom This pointer recreated and properly inilized.
+ // Return:
+ // none.
+ const Double_t kcm2micron = 1.0E4;
+ Int_t i;
+
+ switch (idet){
+ case kSPD:{
+ initSeg[idet] = kTRUE;
+ AliITSsegmentationSPD *segSPD = new AliITSsegmentationSPD();
+ segSPD->SetDetSize(2.*shapePar[0]*kcm2micron, // X
+ 2.*shapePar[2]*kcm2micron, // Z
+ 2.*shapePar[1]*kcm2micron);// Y Microns
+ segSPD->SetNPads(256,160);// Number of Bins in x and z
+ Float_t bx[256],bz[280];
+ for(i=000;i<256;i++) bx[i] = 50.0; // in x all are 50 microns.
+ for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns
+ // except below
+ for(i=160;i<280;i++) bz[i] = 0.0; // Outside of detector.
+ bz[ 31] = bz[ 32] = 625.0; // first chip boundry
+ bz[ 63] = bz[ 64] = 625.0; // first chip boundry
+ bz[ 95] = bz[ 96] = 625.0; // first chip boundry
+ bz[127] = bz[128] = 625.0; // first chip boundry
+ bz[160] = 425.0;// Set so that there is no zero pixel size for fNz.
+ segSPD->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
+ geom->ReSetShape(idet,segSPD);
+ }break;
+ case kSDD:{
+ initSeg[idet] = kTRUE;
+ AliITSsegmentationSDD *segSDD = new AliITSsegmentationSDD();
+ segSDD->SetDetSize(shapePar[0]*kcm2micron, // X
+ 2.*shapePar[2]*kcm2micron, // Z
+ 2.*shapePar[1]*kcm2micron);// Y Microns
+ segSDD->SetNPads(256,256);// Anodes, Samples
+ geom->ReSetShape(idet,segSDD);
+ }break;
+ case kSSD:{
+ initSeg[idet] = kTRUE;
+ AliITSsegmentationSSD *segSSD = new AliITSsegmentationSSD();
+ segSSD->SetDetSize(2.*shapePar[0]*kcm2micron, // X
+ 2.*shapePar[2]*kcm2micron, // Z
+ 2.*shapePar[1]*kcm2micron);// Y Microns.
+ segSSD->SetPadSize(95.,0.); // strip x pitch in microns
+ segSSD->SetNPads(768,2); // number of strips on each side, sides.
+ segSSD->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
+ segSSD->SetAnglesLay5(0.0075,0.0275);//strip angels rad P and N
+ segSSD->SetAnglesLay6(0.0275,0.0075);//strip angels rad P and N
+ geom->ReSetShape(idet,segSSD);
+ }break;
+ default:{// Others, Note no kSDDp or kSSDp in this geometry.
+ geom->ReSetShape(idet,0);
+ Info("InitSegmentationPPRasymmFMD",
+ "default segmentation Dx=%f Dy=%f Dz=%f default=%d",
+ shapePar[0],shapePar[1],shapePar[2],idet);
+ }break;
+ } // end switch
+ return kTRUE;
+}
+//______________________________________________________________________
+Bool_t AliITSInitGeometry::GetTransformation(const TString &volumePath,
+ TGeoHMatrix &mat){
+ // Returns the Transformation matrix between the volume specified
+ // by the path volumePath and the Top or mater volume. The format
+ // of the path volumePath is as follows (assuming ALIC is the Top volume)
+ // "/ALIC_1/DDIP_1/S05I_2/S05H_1/S05G_3". Here ALIC is the top most
+ // or master volume which has only 1 instance of. Of all of the daughter
+ // volumes of ALICE, DDIP volume copy #1 is indicated. Similarly for
+ // the daughter volume of DDIP is S05I copy #2 and so on.
+ // Inputs:
+ // TString& volumePath The volume path to the specific volume
+ // for which you want the matrix. Volume name
+ // hierarchy is separated by "/" while the
+ // copy number is appended using a "_".
+ // Outputs:
+ // TGeoHMatrix &mat A matrix with its values set to those
+ // appropriate to the Local to Master transformation
+ // Return:
+ // A logical value if kFALSE then an error occurred and no change to
+ // mat was made.
+
+ // We have to preserve the modeler state
+
+ // Preserve the modeler state.
+ gGeoManager->PushPath();
+ if (!gGeoManager->cd(volumePath.Data())) {
+ gGeoManager->PopPath();
+ Error("GetTransformation","Error in cd-ing to ",volumePath.Data());
+ return kFALSE;
+ } // end if !gGeoManager
+ mat = *gGeoManager->GetCurrentMatrix();
+ // Retstore the modeler state.
+ gGeoManager->PopPath();
+ return kTRUE;
+}
+//______________________________________________________________________
+Bool_t AliITSInitGeometry::GetShape(const TString &volumePath,
+ TString &shapeType,TArrayD &par){
+ // Returns the shape and its parameters for the volume specified
+ // by volumeName.
+ // Inputs:
+ // TString& volumeName The volume name
+ // Outputs:
+ // TString &shapeType Shape type
+ // TArrayD &par A TArrayD of parameters with all of the
+ // parameters of the specified shape.
+ // Return:
+ // A logical indicating whether there was an error in getting this
+ // information
+ Int_t npar;
+ gGeoManager->PushPath();
+ if (!gGeoManager->cd(volumePath.Data())) {
+ gGeoManager->PopPath();
+ return kFALSE;
+ }
+ TGeoVolume * vol = gGeoManager->GetCurrentVolume();
+ gGeoManager->PopPath();
+ if (!vol) return kFALSE;
+ TGeoShape *shape = vol->GetShape();
+ TClass *class_type = shape->IsA();
+ if (class_type==TGeoBBox::Class()) {
+ shapeType = "BOX";
+ npar = 3;
+ par.Set(npar);
+ TGeoBBox *box = (TGeoBBox*)shape;
+ par.AddAt(box->GetDX(),0);
+ par.AddAt(box->GetDY(),1);
+ par.AddAt(box->GetDZ(),2);
+ return kTRUE;
+ }
+ if (class_type==TGeoTrd1::Class()) {
+ shapeType = "TRD1";
+ npar = 4;
+ par.Set(npar);
+ TGeoTrd1 *trd1 = (TGeoTrd1*)shape;
+ par.AddAt(trd1->GetDx1(),0);
+ par.AddAt(trd1->GetDx2(),1);
+ par.AddAt(trd1->GetDy(), 2);
+ par.AddAt(trd1->GetDz(), 3);
+ return kTRUE;
+ }
+ if (class_type==TGeoTrd2::Class()) {
+ shapeType = "TRD2";
+ npar = 5;
+ par.Set(npar);
+ TGeoTrd2 *trd2 = (TGeoTrd2*)shape;
+ par.AddAt(trd2->GetDx1(),0);
+ par.AddAt(trd2->GetDx2(),1);
+ par.AddAt(trd2->GetDy1(),2);
+ par.AddAt(trd2->GetDy2(),3);
+ par.AddAt(trd2->GetDz(), 4);
+ return kTRUE;
+ }
+ if (class_type==TGeoTrap::Class()) {
+ shapeType = "TRAP";
+ npar = 11;
+ par.Set(npar);
+ TGeoTrap *trap = (TGeoTrap*)shape;
+ Double_t tth = TMath::Tan(trap->GetTheta()*TMath::DegToRad());
+ par.AddAt(trap->GetDz(),0);
+ par.AddAt(tth*TMath::Cos(trap->GetPhi()*TMath::DegToRad()),1);
+ par.AddAt(tth*TMath::Sin(trap->GetPhi()*TMath::DegToRad()),2);
+ par.AddAt(trap->GetH1(),3);
+ par.AddAt(trap->GetBl1(),4);
+ par.AddAt(trap->GetTl1(),5);
+ par.AddAt(TMath::Tan(trap->GetAlpha1()*TMath::DegToRad()),6);
+ par.AddAt(trap->GetH2(),7);
+ par.AddAt(trap->GetBl2(),8);
+ par.AddAt(trap->GetTl2(),9);
+ par.AddAt(TMath::Tan(trap->GetAlpha2()*TMath::DegToRad()),10);
+ return kTRUE;
+ }
+ if (class_type==TGeoTube::Class()) {
+ shapeType = "TUBE";
+ npar = 3;
+ par.Set(npar);
+ TGeoTube *tube = (TGeoTube*)shape;
+ par.AddAt(tube->GetRmin(),0);
+ par.AddAt(tube->GetRmax(),1);
+ par.AddAt(tube->GetDz(),2);
+ return kTRUE;
+ }
+ if (class_type==TGeoTubeSeg::Class()) {
+ shapeType = "TUBS";
+ npar = 5;
+ par.Set(npar);
+ TGeoTubeSeg *tubs = (TGeoTubeSeg*)shape;
+ par.AddAt(tubs->GetRmin(),0);
+ par.AddAt(tubs->GetRmax(),1);
+ par.AddAt(tubs->GetDz(),2);
+ par.AddAt(tubs->GetPhi1(),3);
+ par.AddAt(tubs->GetPhi2(),4);
+ return kTRUE;
+ }
+ if (class_type==TGeoCone::Class()) {
+ shapeType = "CONE";
+ npar = 5;
+ par.Set(npar);
+ TGeoCone *cone = (TGeoCone*)shape;
+ par.AddAt(cone->GetDz(),0);
+ par.AddAt(cone->GetRmin1(),1);
+ par.AddAt(cone->GetRmax1(),2);
+ par.AddAt(cone->GetRmin2(),3);
+ par.AddAt(cone->GetRmax2(),4);
+ return kTRUE;
+ }
+ if (class_type==TGeoConeSeg::Class()) {
+ shapeType = "CONS";
+ npar = 7;
+ par.Set(npar);
+ TGeoConeSeg *cons = (TGeoConeSeg*)shape;
+ par.AddAt(cons->GetDz(),0);
+ par.AddAt(cons->GetRmin1(),1);
+ par.AddAt(cons->GetRmax1(),2);
+ par.AddAt(cons->GetRmin2(),3);
+ par.AddAt(cons->GetRmax2(),4);
+ par.AddAt(cons->GetPhi1(),5);
+ par.AddAt(cons->GetPhi2(),6);
+ return kTRUE;
+ }
+ if (class_type==TGeoSphere::Class()) {
+ shapeType = "SPHE";
+ npar = 6;
+ par.Set(npar);
+
+ TGeoSphere *sphe = (TGeoSphere*)shape;
+ par.AddAt(sphe->GetRmin(),0);
+ par.AddAt(sphe->GetRmax(),1);
+ par.AddAt(sphe->GetTheta1(),2);
+ par.AddAt(sphe->GetTheta2(),3);
+ par.AddAt(sphe->GetPhi1(),4);
+ par.AddAt(sphe->GetPhi2(),5);
+ return kTRUE;
+ }
+ if (class_type==TGeoPara::Class()) {
+ shapeType = "PARA";
+ npar = 6;
+ par.Set(npar);
+ TGeoPara *para = (TGeoPara*)shape;
+ par.AddAt(para->GetX(),0);
+ par.AddAt(para->GetY(),1);
+ par.AddAt(para->GetZ(),2);
+ par.AddAt(para->GetTxy(),3);
+ par.AddAt(para->GetTxz(),4);
+ par.AddAt(para->GetTyz(),5);
+ return kTRUE;
+ }
+ if (class_type==TGeoPgon::Class()) {
+ shapeType = "PGON";
+ TGeoPgon *pgon = (TGeoPgon*)shape;
+ Int_t nz = pgon->GetNz();
+ const Double_t *rmin = pgon->GetRmin();
+ const Double_t *rmax = pgon->GetRmax();
+ const Double_t *z = pgon->GetZ();
+ npar = 4 + 3*nz;
+ par.Set(npar);
+ par.AddAt(pgon->GetPhi1(),0);
+ par.AddAt(pgon->GetDphi(),1);
+ par.AddAt(pgon->GetNedges(),2);
+ par.AddAt(pgon->GetNz(),3);
+ for (Int_t i=0; i<nz; i++) {
+ par.AddAt(z[i], 4+3*i);
+ par.AddAt(rmin[i], 4+3*i+1);
+ par.AddAt(rmax[i], 4+3*i+2);
+ }
+ return kTRUE;
+ }
+ if (class_type==TGeoPcon::Class()) {
+ shapeType = "PCON";
+ TGeoPcon *pcon = (TGeoPcon*)shape;
+ Int_t nz = pcon->GetNz();
+ const Double_t *rmin = pcon->GetRmin();
+ const Double_t *rmax = pcon->GetRmax();
+ const Double_t *z = pcon->GetZ();
+ npar = 3 + 3*nz;
+ par.Set(npar);
+ par.AddAt(pcon->GetPhi1(),0);
+ par.AddAt(pcon->GetDphi(),1);
+ par.AddAt(pcon->GetNz(),2);
+ for (Int_t i=0; i<nz; i++) {
+ par.AddAt(z[i], 3+3*i);
+
+ par.AddAt(rmin[i], 3+3*i+1);
+ par.AddAt(rmax[i], 3+3*i+2);
+ }
+ return kTRUE;
+ }
+ if (class_type==TGeoEltu::Class()) {
+ shapeType = "ELTU";
+ npar = 3;
+ par.Set(npar);
+ TGeoEltu *eltu = (TGeoEltu*)shape;
+ par.AddAt(eltu->GetA(),0);
+ par.AddAt(eltu->GetB(),1);
+ par.AddAt(eltu->GetDz(),2);
+ return kTRUE;
+ }
+ if (class_type==TGeoHype::Class()) {
+ shapeType = "HYPE";
+ npar = 5;
+ par.Set(npar);
+ TGeoHype *hype = (TGeoHype*)shape;
+ par.AddAt(TMath::Sqrt(hype->RadiusHypeSq(0.,kTRUE)),0);
+ par.AddAt(TMath::Sqrt(hype->RadiusHypeSq(0.,kFALSE)),1);
+ par.AddAt(hype->GetDZ(),2);
+ par.AddAt(hype->GetStIn(),3);
+ par.AddAt(hype->GetStOut(),4);
+ return kTRUE;
+ }
+ if (class_type==TGeoGtra::Class()) {
+ shapeType = "GTRA";
+ npar = 12;
+ par.Set(npar);
+ TGeoGtra *trap = (TGeoGtra*)shape;
+ Double_t tth = TMath::Tan(trap->GetTheta()*TMath::DegToRad());
+ par.AddAt(trap->GetDz(),0);
+ par.AddAt(tth*TMath::Cos(trap->GetPhi()*TMath::DegToRad()),1);
+ par.AddAt(tth*TMath::Sin(trap->GetPhi()*TMath::DegToRad()),2);
+ par.AddAt(trap->GetH1(),3);
+ par.AddAt(trap->GetBl1(),4);
+ par.AddAt(trap->GetTl1(),5);
+ par.AddAt(TMath::Tan(trap->GetAlpha1()*TMath::DegToRad()),6);
+ par.AddAt(trap->GetH2(),7);
+ par.AddAt(trap->GetBl2(),8);
+ par.AddAt(trap->GetTl2(),9);
+ par.AddAt(TMath::Tan(trap->GetAlpha2()*TMath::DegToRad()),10);
+ par.AddAt(trap->GetTwistAngle(),11);
+ return kTRUE;
+ }
+ if (class_type==TGeoCtub::Class()) {
+ shapeType = "CTUB";
+ npar = 11;
+ par.Set(npar);
+ TGeoCtub *ctub = (TGeoCtub*)shape;
+ const Double_t *lx = ctub->GetNlow();
+ const Double_t *tx = ctub->GetNhigh();
+ par.AddAt(ctub->GetRmin(),0);
+ par.AddAt(ctub->GetRmax(),1);
+ par.AddAt(ctub->GetDz(),2);
+ par.AddAt(ctub->GetPhi1(),3);
+ par.AddAt(ctub->GetPhi2(),4);
+ par.AddAt(lx[0],5);
+ par.AddAt(lx[1],6);
+ par.AddAt(lx[2],7);
+ par.AddAt(tx[0],8);
+ par.AddAt(tx[1],9);
+ par.AddAt(tx[2],10);
+ return kTRUE;
+ }
+ Error("GetShape","Getting shape parameters for shape %s not implemented",
+ shape->ClassName());
+ return kFALSE;
+}
+//______________________________________________________________________
+void AliITSInitGeometry::DecodeDetector(Int_t &mod,Int_t layer,Int_t cpn0,
+ Int_t cpn1,Int_t cpn2){
+ // decode geometry into detector module number. There are two decoding
+ // Scheams. Old which does not follow the ALICE coordinate system
+ // requirements, and New which dose.
+ // Inputs:
+ // Int_t layer The ITS layer
+ // Int_t cpn0 The lowest copy number
+ // Int_t cpn1 The middle copy number
+ // Int_t cpn2 the highest copy number
+ // Output:
+ // Int_t &mod The module number assoicated with this set
+ // of copy numbers.
+ // Return:
+ // none.
+ const Int_t detPerLadderSPD[2]={2,4};
+ const Int_t detPerLadder[6]={4,4,6,8,22,25};
+ const Int_t ladPerLayer[6]={20,40,14,22,34,38};
+ Int_t lay,lad,det,i;
+
+ if(fDecode){ // New decoding scheam
+ switch (layer){
+ case 1:{
+ lay = layer;
+ det = 5-cpn2;
+ if(cpn0==4&&cpn1==1) lad=1;
+ else if(cpn0==4&&cpn1==2) lad=20;
+ else if(cpn0<4){
+ lad = 8-cpn1-detPerLadderSPD[layer-1]*(cpn0-1);
+ }else{ // cpn0>4
+ lad = 28-cpn1-detPerLadderSPD[layer-1]*(cpn0-1);
+ } // end if
+ } break;
+ case 2:{
+ lay = layer;
+ det = 5-cpn2;
+ if(cpn0==4&&cpn1==1) lad=1;
+ else if(cpn0<4){
+ lad = 14-cpn1-detPerLadderSPD[layer-1]*(cpn0-1);
+ }else{ // cpn0>4
+ lad = 54-cpn1-detPerLadderSPD[layer-1]*(cpn0-1);
+ } // end if
+ } break;
+ case 3:{
+ lay = layer;
+ if(cpn0<5) lad = 5-cpn0;
+ else lad = 19-cpn0;
+ det = 7-cpn1;
+ } break;
+ case 4:{
+ lay = layer;
+ if(cpn0<7) lad = 7-cpn0;
+ else lad = 29-cpn0;
+ det = 9-cpn1;
+ } break;
+ case 5:{
+ lay = layer;
+ if(cpn0<10) lad = 10-cpn0;
+ else lad = 44-cpn0;
+ det = 23-cpn1;
+ } break;
+ case 6:{
+ lay = layer;
+ if(cpn0<9) lad = 9-cpn0;
+ else lad = 47-cpn0;
+ det = 26-cpn1;
+ } break;
+ } // end switch
+ mod = 0;
+ for(i=0;i<layer-1;i++) mod += ladPerLayer[i]*detPerLadder[i];
+ mod += detPerLadder[layer-1]*(lad-1)+det-1;// module start at zero.
+ return;
+ } // end if
+ // Old decoding scheam
+ switch(layer){
+ case 1: case 2:{
+ lay = layer;
+ lad = cpn1+detPerLadderSPD[layer-1]*(cpn0-1);
+ det = cpn2;
+ }break;
+ case 3: case 4:{
+ lay = layer;
+ lad = cpn0;
+ det = cpn1;
+ }break;
+ case 5: case 6:{
+ lay = layer;
+ lad = cpn0;
+ det = cpn1;
+ }break;
+ default:{
+ }break;
+ } // end switch
+ mod = 0;
+ for(i=0;i<layer-1;i++) mod += ladPerLayer[i]*detPerLadder[i];
+ mod += detPerLadder[layer-1]*(lad-1)+det-1;// module start at zero.
+ return;
+}
+//______________________________________________________________________
+void AliITSInitGeometry::RecodeDetector(Int_t mod,Int_t &cpn0,
+ Int_t &cpn1,Int_t &cpn2){
+ // decode geometry into detector module number. There are two decoding
+ // Scheams. Old which does not follow the ALICE coordinate system
+ // requirements, and New which dose.
+ // Inputs:
+ // Int_t mod The module number assoicated with this set
+ // of copy numbers.
+ // Output:
+ // Int_t cpn0 The lowest copy number
+ // Int_t cpn1 The middle copy number
+ // Int_t cpn2 the highest copy number
+ // Return:
+ // none.
+ const Int_t itsGeomTreeCopys[6][3]= {{10, 2, 4},// lay=1
+ {10, 4, 4},// lay=2
+ {14, 6, 1},// lay=3
+ {22, 8, 1},// lay=4
+ {34,22, 1},// lay=5
+ {38,25, 1}};//lay=6
+ const Int_t detPerLadderSPD[2]={2,4};
+ // const Int_t detPerLadder[6]={4,4,6,8,22,25};
+ // const Int_t ladPerLayer[6]={20,40,14,22,34,38};
+ Int_t lay,lad,det;
+
+ cpn0 = cpn1 = cpn2 = 0;
+ DecodeDetectorLayers(mod,lay,lad,det);
+ if(fDecode){ // New decoding scheam
+ switch (lay){
+ case 1:{
+ cpn2 = 5-det; // Detector 1-4
+ cpn1 = 1+(lad-1)%detPerLadderSPD[lay-1];
+ cpn0 = 5-(lad+detPerLadderSPD[lay-1])/detPerLadderSPD[lay-1];
+ if(mod>27) cpn0 = 15-(lad+detPerLadderSPD[lay-1])/
+ detPerLadderSPD[lay-1];
+ } break;
+ case 2:{
+ cpn2 = 5-det; // Detector 1-4
+ cpn1 = 4-(lad+2)%detPerLadderSPD[lay-1];
+ cpn0 = 1+(14-cpn1-lad)/detPerLadderSPD[lay-1];
+ if(mod>131) cpn0 = 1+(54-lad-cpn1)/detPerLadderSPD[lay-1];
+ } break;
+ case 3:{
+ cpn2 = 1;
+ if(lad<5) cpn0 = 5-lad;
+ else cpn0 = 19-lad;
+ cpn1 = 7-det;
+ } break;
+ case 4:{
+ cpn2 = 1;
+ if(lad<7) cpn0 = 7-lad;
+ else cpn0 = 29-lad;
+ cpn1 = 9-det;
+ } break;
+ case 5:{
+ cpn2 = 1;
+ if(lad<10) cpn0 = 10-lad;
+ else cpn0 = 44-lad;
+ cpn1 = 23-det;
+ } break;
+ case 6:{
+ cpn2 = 1;
+ if(lad<9) cpn0 = 9-lad;
+ else cpn0 = 47-lad;
+ cpn1 = 26-det;
+ } break;
+ default:{
+ Error("RecodeDetector","New: mod=%d lay=%d not 1-6.");
+ return;
+ } break;
+ } // end switch
+ if(cpn0<1||cpn1<1||cpn2<1||
+ cpn0>itsGeomTreeCopys[lay-1][0]||
+ cpn1>itsGeomTreeCopys[lay-1][1]||
+ cpn2>itsGeomTreeCopys[lay-1][2])
+ Error("RecodeDetector",
+ "cpn0=%d cpn1=%d cpn2=%d mod=%d lay=%d lad=%d det=%d",
+ cpn0,cpn1,cpn2,mod,lay,lad,det);
+ return;
+ } // end if
+ // Old encoding
+ switch (lay){
+ case 1: case 2:{
+ cpn2 = det; // Detector 1-4
+ cpn0 = (lad+detPerLadderSPD[lay-1]-1)/detPerLadderSPD[lay-1];
+ cpn1 = (lad+detPerLadderSPD[lay-1]-1)%detPerLadderSPD[lay-1] + 1;
+ } break;
+ case 3: case 4: case 5 : case 6:{
+ cpn2 = 1;
+ cpn1 = det;
+ cpn0 = lad;
+ } break;
+ default:{
+ Error("RecodeDetector","Old: mod=%d lay=%d not 1-6.");
+ return;
+ } break;
+ } // end switch
+ if(cpn0<1||cpn1<1||cpn2<1||
+ cpn0>itsGeomTreeCopys[lay-1][0]||
+ cpn1>itsGeomTreeCopys[lay-1][1]||
+ cpn2>itsGeomTreeCopys[lay-1][2])
+ Error("RecodeDetector",
+ "cpn0=%d cpn1=%d cpn2=%d mod=%d lay=%d lad=%d det=%d",
+ cpn0,cpn1,cpn2,mod,lay,lad,det);
+ return;
+}
+//______________________________________________________________________
+void AliITSInitGeometry::DecodeDetectorLayers(Int_t mod,Int_t &lay,
+ Int_t &lad,Int_t &det){
+ // decode geometry into detector module number. There are two decoding
+ // Scheams. Old which does not follow the ALICE coordinate system
+ // requirements, and New which dose. Note, this use of layer ladder
+ // and detector numbers are strictly for internal use of this
+ // specific code. They do not represent the "standard" layer ladder
+ // or detector numbering except in a very old and obsoleate sence.
+ // Inputs:
+ // Int_t mod The module number assoicated with this set
+ // of copy numbers.
+ // Output:
+ // Int_t lay The layer number
+ // Int_t lad The ladder number
+ // Int_t det the dettector number
+ // Return:
+ // none.
+ // const Int_t detPerLadderSPD[2]={2,4};
+ const Int_t detPerLadder[6]={4,4,6,8,22,25};
+ const Int_t ladPerLayer[6]={20,40,14,22,34,38};
+ Int_t mod2;
+
+ det = 0;
+ lad = 0;
+ lay = 0;
+ mod2 = 0;
+ do{
+ mod2 += ladPerLayer[lay]*detPerLadder[lay];
+ lay++;
+ }while(mod2<=mod); // end while
+ if(lay>6||lay<1) Error("DecodeDetectorLayers","0<lay=%d>6",lay);
+ mod2 -= ladPerLayer[lay-1]*detPerLadder[lay-1];
+ do{
+ lad++;
+ mod2 += detPerLadder[lay-1];
+ }while(mod2<=mod); // end while
+ if(lad>ladPerLayer[lay-1]||lad<1) Error("DecodeDetectorLayera",
+ "lad=%d>ladPerLayer[lay-1=%d]=%d mod=%d mod2=%d",lad,lay-1,
+ ladPerLayer[lay-1],mod,mod2);
+ mod2 -= detPerLadder[lay-1];
+ det = mod-mod2+1;
+ if(det>detPerLadder[lay-1]||det<1) Error("DecodeDetectorLayers",
+ "det=%d>detPerLayer[lay-1=%d]=%d mod=%d mod2=%d lad=%d",det,
+ lay-1,detPerLadder[lay-1],mod,mod2,lad);
+ return;
+}
+
--- /dev/null
+#ifndef ALIITSINITGEOMETRY_H
+#define ALIITSINITGEOMETRY_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/*
+$Id$
+*/
+
+/*
+ Class to inilize AliITSgeom and the like for both simulation
+ and reconstriction.
+ */
+#include <TObject.h>
+#include <TArrayD.h>
+#include <TString.h>
+#include <TGeoMatrix.h>
+
+#include "AliITSgeom.h"
+
+class AliITSInitGeometry : public TObject{
+ public:
+ AliITSInitGeometry(); // Default Creator
+ AliITSInitGeometry(const Char_t *name,Int_t minorversion);//Standard Creator
+ //virtual ~AliITSInitGeometry(); // Destructor
+ //
+ AliITSgeom* CreateAliITSgeom(); // Create and intilize geometry from TGeom
+ Bool_t InitAliITSgeom(AliITSgeom *geom);//Initilize goemetry from gGeoManager
+ // Getters and Setters
+ TString GetGeometryName()const {return fName;}// Return geometry name
+ void SetGeometryName(const Char_t *name){fName = name;}// Set Geometry name
+ Int_t GetMajorVersion()const {return fMajorVersion;} // Return geometry major version
+ void SetMajorVersion(Int_t majorVersion){fMajorVersion = majorVersion;} // Set geometry major version
+ Int_t GetMinorVersion()const{return fMinorVersion;}// Return geometry minor version
+ void SetMinorVersion(Int_t minorVersion){fMinorVersion = minorVersion;}
+ Bool_t GetTiming()const{return fTiming;} // return routine timing flag
+ void SetTiming(Bool_t time=kTRUE){fTiming=time;}// Set routine timing (on)
+ Bool_t GetSegGeom()const{return fSegGeom;} // return flag indecating the use of AliITSsegmentation or AliITSgeomS?D class in fShape.
+ void SetSegGeom(Bool_t seg=kTRUE){fSegGeom = seg;}// Set the use of AliITSsegmentation class' instead of AliITSgeomS?D class in fShape
+ Bool_t GetDecoding()const{return fDecode;}// Return flag indecating wether to use new/old decoding
+ void SetDecoding(Bool_t newdec=kFALSE){fDecode = newdec;}// Set flag to use new/old decoding
+
+ private:
+ // Virtual MC code reproduction
+ Bool_t InitAliITSgeomPPRasymmFMD(AliITSgeom *geom);
+ Bool_t InitGeomShapePPRasymmFMD(AliITSDetector idet,Bool_t *initSeg,
+ TArrayD &shapePar,AliITSgeom *geom);
+ Bool_t InitSegmentationPPRasymmFMD(AliITSDetector idet,Bool_t *initSeg,
+ TArrayD &shapePar,AliITSgeom *geom);
+ Bool_t GetTransformation(const TString &volumePath,TGeoHMatrix &mat);
+ Bool_t GetShape(const TString &volumePath,TString &shapeType,TArrayD &par);
+ void DecodeDetectorLayers(Int_t mod,Int_t &lay,Int_t &lad,Int_t &det);
+ void DecodeDetector(Int_t &mod,Int_t lay,Int_t cpn0,Int_t cpn1,Int_t cpn2);
+ void RecodeDetector(Int_t mod,Int_t &cpn0,Int_t &cpn1,Int_t &cpn2);
+
+ TString fName; // Geometry name
+ Int_t fMinorVersion; // Geometry minor version
+ Int_t fMajorVersion; // Geometry swich value
+ Bool_t fTiming; // Flag to start inilization timing
+ Bool_t fSegGeom; // Flag to switch between the old use of
+ // AliITSgeomS?D class, or AliITSsegmentation
+ // class in fShape of AliITSgeom class.
+ Bool_t fDecode; // Flag for new/old decoding
+
+ ClassDef(AliITSInitGeometry,0) // create/Init AliITSgeom
+ // 0 in ClassDef indicates that this class will not be "saved" in a file.
+};
+
+#endif
+
fDataLoaders->Remove(dl);
if(fITSpid)delete fITSpid;
if(fGeom)delete fGeom;
+ fGeom = 0;
}
/*
//----------------------------------------------------------------------
AliWarning("AliITSgeom object has been fetched from galice.root file");
return fGeom;
}
+//______________________________________________________________________
+void AliITSLoader::SetITSgeom(AliITSgeom *geom){
+ // Replaces the AliITSgeom object read from file with the one
+ // given.
+ // Inputs:
+ // AliITSgeom *geom The AliITSgeom object to replace the one
+ // read from the file
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+
+ if(fGeom==geom) return; // Same do nothing
+ if(fGeom) {
+ delete fGeom;
+ fGeom=0;
+ }// end if
+ fGeom=geom;
+}
// Geometry. Geom is read from file, unless already loaded
// readout from file can be forced if force=kTRUE
AliITSgeom* GetITSgeom(Bool_t force=kFALSE);
- void SetITSgeom(AliITSgeom* g){fGeom=g;}
+ void SetITSgeom(AliITSgeom* g);
// PID
AliITSpidESD* GetITSpid() const {return fITSpid;}
void AdoptITSpid(AliITSpidESD* pid) {fITSpid=pid;}
#include "AliITSpidESD2.h"
#include "AliV0vertexer.h"
#include "AliCascadeVertexer.h"
+#include "AliITSInitGeometry.h"
ClassImp(AliITSReconstructor)
Error("= operator","Assignment operator not allowed\n");
return *this;
}
+//______________________________________________________________________
+void AliITSReconstructor::Init(AliRunLoader *runLoader){
+ // Initalize this constructor bet getting/creating the objects
+ // nesseary for a proper ITS reconstruction.
+ // Inputs:
+ // AliRunLoader *runLoader Pointer to the run loader to allow
+ // the getting of files/folders data
+ // needed to do reconstruction
+ // Output:
+ // none.
+ // Return:
+ // none.
+ AliITSInitGeometry *initgeom = new AliITSInitGeometry("AliITSvPPRasymmFMD",
+ 2);
+ AliITSgeom *geom = initgeom->CreateAliITSgeom();
+ delete initgeom; // once created, do not need initgeom any more.
+ AliITSLoader* loader = static_cast<AliITSLoader*>
+ (runLoader->GetLoader("ITSLoader"));
+ if (!loader) {
+ Error("Init", "ITS loader not found");
+ return;
+ }
+ loader->SetITSgeom(geom);
+ return;
+}
//_____________________________________________________________________________
void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const
{
return geom;
}
-
virtual ~AliITSReconstructor();
AliITSReconstructor(const AliITSReconstructor &ob); // copy constructor
AliITSReconstructor& operator=(const AliITSReconstructor & /* source */); // ass. op.
-
+ virtual void Init(AliRunLoader* runLoader);
+
virtual void Reconstruct(AliRunLoader* runLoader) const;
virtual void Reconstruct(AliRunLoader* runLoader,
AliRawReader* rawReader) const;
// By: Bjorn S. Nilsen //
// version: 0.0.1 //
// Updated May 27 1999. //
-// Added Cylindrical random and global based changes. //
+// Added Cylindrical random and global based changes. //
// Added function PrintComparison. //
+// Modified and added functions Feb. 7 2006 //
///////////////////////////////////////////////////////////////////////
//
// Data Members:
//
+// TString fVersion
+// Transformation version.
+// Int_t fTrans
+// Flag to keep track of which transformation
+// Int_t fNmodules
+// The total number of modules
// Int_t fNlayers
// The number of ITS layers for this geometry. By default this
// is 6, but can be modified by the creator function if there are
// more layers defined.
//
-// Int_t *fNlad
+// TArrayI fNlad
// A pointer to an array fNlayers long containing the number of
// ladders for each layer. This array is typically created and filled
// by the AliITSgeom creator function.
//
-// Int_t *fNdet
+// TArrayI fNdet
// A pointer to an array fNlayers long containing the number of
// active detector volumes for each ladder. This array is typically
// created and filled by the AliITSgeom creator function.
//
-// AliITSgeomMatrix *fGm
+// TObjArray fGm containing objects of type AliITSgeomMatrix
// A pointer to an array of AliITSgeomMatrix classes. One element
// per module (detector) in the ITS. AliITSgeomMatrix basicly contains
// all of the necessary information about the detector and it's coordinate
// transformations.
//
-// TObjArray *fShape
+// TObjArray fShape containting objects of type AliITSgeom
// A pointer to an array of TObjects containing the detailed shape
// information for each type of detector used in the ITS. For example
-// I have created AliITSgeomSPD, AliITSgeomSDD, and AliITSgeomSSD as
-// example structures, derived from TObjects, to hold the detector
-// information. I would recommend that one element in each of these
-// structures, that which describes the shape of the active volume,
-// be one of the ROOT classes derived from TShape. In this way it would
-// be easy to have the display program display the correct active
-// ITS volumes. See the example classes AliITSgeomSPD, AliITSgeomSDD,
-// and AliITSgeomSSD for a more detailed example.
+// I have created AliITSgeomSPD, AliITSgeomSDD, and
+// AliITSsegmenttionSSD as example structures, derived from TObjects,
+// to hold the detector information. I would recommend that one element
+// in each of these structures, that which describes the shape of the
+// active volume, be one of the ROOT classes derived from TShape. In this
+// way it would be easy to have the display program display the correct
+// active ITS volumes. See the example classes AliITSgeomSPD,
+// AliITSgeomSDD, and AliITSgeomSSD for a more detailed
+// example.
////////////////////////////////////////////////////////////////////////
#include <Riostream.h>
#include <TRandom.h>
#include <TSystem.h>
+#include <TArrayI.h>
-#include "AliITSgeom.h"
-#include "AliITSgeomSDD.h"
#include "AliITSgeomSPD.h"
+#include "AliITSgeomSDD.h"
#include "AliITSgeomSSD.h"
+#include "AliITSgeom.h"
#include "AliLog.h"
ClassImp(AliITSgeom)
//______________________________________________________________________
-AliITSgeom::AliITSgeom(){
+AliITSgeom::AliITSgeom():
+TObject(),
+fVersion("GEANT"),// Transformation version.
+fTrans(0), // Flag to keep track of which transformation
+fNmodules(0), // The total number of modules
+fNlayers(0), // The number of layers.
+fNlad(), //[] Array of the number of ladders/layer(layer)
+fNdet(), //[] Array of the number of detector/ladder(layer)
+fGm(0,0), // Structure of translation. and rotation.
+fShape(0,0) // Array of shapes and detector information.
+{
// The default constructor for the AliITSgeom class. It, by default,
// sets fNlayers to zero and zeros all pointers.
// Do not allocate anything zero everything.
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // a zeroed AliITSgeom object.
- fTrans = 0; // standard GEANT global/local coordinate system.
- fNlayers = 0;
- fNlad = 0;
- fNdet = 0;
- fGm = 0;
- fShape = 0;
- strcpy(fVersion,"test");
+ fGm.SetOwner(kTRUE);
+ fShape.SetOwner(kTRUE);
return;
}
//______________________________________________________________________
-AliITSgeom::AliITSgeom(Int_t itype,Int_t nlayers,Int_t *nlads,Int_t *ndets,
- Int_t mods){
+AliITSgeom::AliITSgeom(Int_t itype,Int_t nlayers,const Int_t *nlads,
+ const Int_t *ndets,Int_t mods):
+TObject(),
+fVersion("GEANT"), // Transformation version.
+fTrans(itype), // Flag to keep track of which transformation
+fNmodules(mods), // The total number of modules
+fNlayers(nlayers), // The number of layers.
+fNlad(nlayers,nlads),//[] Array of the number of ladders/layer(layer)
+fNdet(nlayers,ndets),//[] Array of the number of detector/ladder(layer)
+fGm(mods,0), // Structure of translation. and rotation.
+fShape(5,0) // Array of shapes and detector information.
+{
// A simple constructor to set basic geometry class variables
// Inputs:
- // Int_t itype the type of transformation kept.
- // bit 0 => Standard GEANT
- // bit 1 => ITS tracking
- // bit 2 => A change in the coordinate system has been made.
- // others are still to be defined as needed.
- // Int_t nlayers The number of ITS layers also set the size of the arrays
- // Int_t *nlads an array of the number of ladders for each layer. This
- // array must be nlayers long.
- // Int_t *ndets an array of the number of detectors per ladder for each
- // layer. This array must be nlayers long.
- // Int_t mods The number of modules. Typicaly the sum of all the
- // detectors on every layer and ladder.
+ // Int_t itype the type of transformation kept.
+ // bit 0 => Standard GEANT
+ // bit 1 => ITS tracking
+ // bit 2 => A change in the coordinate system has been made.
+ // others are still to be defined as needed.
+ // Int_t nlayers The number of ITS layers also set the size of the arrays
+ // Int_t *nlads an array of the number of ladders for each layer. This
+ // array must be nlayers long.
+ // Int_t *ndets an array of the number of detectors per ladder for each
+ // layer. This array must be nlayers long.
+ // Int_t mods The number of modules. Typically the sum of all the
+ // detectors on every layer and ladder.
// Outputs:
- // none
- Int_t i;
+ // none
+ // Return:
+ // A properly inilized AliITSgeom object.
+
+ fGm.SetOwner(kTRUE);
+ fShape.SetOwner(kTRUE);
+ return;
+}
+//______________________________________________________________________
+void AliITSgeom::Init(Int_t itype,Int_t nlayers,const Int_t *nlads,
+ const Int_t *ndets,Int_t mods){
+ // A simple Inilizer to set basic geometry class variables
+ // Inputs:
+ // Int_t itype the type of transformation kept.
+ // bit 0 => Standard GEANT
+ // bit 1 => ITS tracking
+ // bit 2 => A change in the coordinate system has been made.
+ // others are still to be defined as needed.
+ // Int_t nlayers The number of ITS layers also set the size of the arrays
+ // Int_t *nlads an array of the number of ladders for each layer. This
+ // array must be nlayers long.
+ // Int_t *ndets an array of the number of detectors per ladder for each
+ // layer. This array must be nlayers long.
+ // Int_t mods The number of modules. Typically the sum of all the
+ // detectors on every layer and ladder.
+ // Outputs:
+ // none
+ // Return:
+ // A properly inilized AliITSgeom object.
- fTrans = itype;
- fNlayers = nlayers;
- fNlad = new Int_t[nlayers];
- fNdet = new Int_t[nlayers];
- for(i=0;i<nlayers;i++){fNlad[i] = nlads[i];fNdet[i] = ndets[i];}
- fNmodules = mods;
- fGm = new TObjArray(mods,0);
- fShape = new TObjArray(5); // default value
- for(i=0;i<5;i++) fShape->AddAt(0,i);
- strcpy(fVersion,"test");
+ fVersion = "GEANT"; // Transformation version.
+ fTrans = itype; // Flag to keep track of which transformation
+ fNmodules = mods; // The total number of modules
+ fNlayers = nlayers; // The number of layers.
+ fNlad.Set(nlayers,nlads);//[] Array of the number of ladders/layer(layer)
+ fNdet.Set(nlayers,ndets);//[] Array of the number of detector/ladder(layer)
+ fGm.Clear();
+ fGm.Expand(mods); // Structure of translation. and rotation.
+ fGm.SetOwner(kTRUE);
+ fShape.Clear();
+ fShape.Expand(5); // Array of shapes and detector information.
+ fShape.SetOwner(kTRUE);
return;
}
//______________________________________________________________________
-void AliITSgeom::CreatMatrix(Int_t mod,Int_t lay,Int_t lad,Int_t det,
- AliITSDetector idet,const Double_t tran[3],
- const Double_t rot[10]){
+void AliITSgeom::CreateMatrix(Int_t mod,Int_t lay,Int_t lad,Int_t det,
+ AliITSDetector idet,const Double_t tran[3],
+ const Double_t rot[10]){
// Given the translation vector tran[3] and the rotation matrix rot[1],
// this function creates and adds to the TObject Array fGm the
// AliITSgeomMatrix object.
- // Inputs are:
- // Int_t mod The module number. The location in TObjArray
- // Int_t lay The layer where this module is
- // Int_t lad On which ladder this module is
- // Int_t det Which detector on this ladder this module is
- // AliITSDetector idet The type of detector see AliITSgeom.h
- // Double_t tran[3] The translation vector
- // Double_t rot[10] The rotation matrix.
- // Outputs are:
- // none
// The rot[10] matrix is set up like:
/* / rot[0] rot[1] rot[2] \
// | rot[3] rot[4] rot[5] |
// \ rot[6] rot[7] rot[8] / if(rot[9]!=0) then the Identity matrix
// is used regardless of the values in rot[0]-rot[8].
*/
+ // Inputs:
+ // Int_t mod The module number. The location in TObjArray
+ // Int_t lay The layer where this module is
+ // Int_t lad On which ladder this module is
+ // Int_t det Which detector on this ladder this module is
+ // AliITSDetector idet The type of detector see AliITSgeom.h
+ // Double_t tran[3] The translation vector
+ // Double_t rot[10] The rotation matrix.
+ // Outputs:
+ // none
+ // Return:
+ // none.
Int_t id[3];
Double_t r[3][3] = {{1.0,0.0,0.0},{0.0,1.0,0.0},{0.0,0.0,1.0}};
- if(fGm->At(mod)!=0) delete fGm->At(mod);
+ if(mod<0||mod>=fGm.GetSize()){
+ Error("CreateMatrix","mod=%d is out of bounds max value=%d",mod,
+ fGm.GetSize());
+ return;
+ } // end if
+ delete fGm.At(mod);
id[0] = lay; id[1] = lad; id[2] = det;
if(rot[9]!=0.0) { // null rotation
- r[0][0] = rot[0]; r[0][1] = rot[1]; r[0][2] = rot[2];
- r[1][0] = rot[3]; r[1][1] = rot[4]; r[1][2] = rot[5];
- r[2][0] = rot[6]; r[2][1] = rot[7]; r[2][2] = rot[8];
+ r[0][0] = rot[0]; r[0][1] = rot[1]; r[0][2] = rot[2];
+ r[1][0] = rot[3]; r[1][1] = rot[4]; r[1][2] = rot[5];
+ r[2][0] = rot[6]; r[2][1] = rot[7]; r[2][2] = rot[8];
} // end if
- fGm->AddAt(new AliITSgeomMatrix(idet,id,r,tran),mod);
+ fGm.AddAt(new AliITSgeomMatrix(idet,id,r,tran),mod);
}
//______________________________________________________________________
AliITSgeom::~AliITSgeom(){
// are non zero, then this memory space is freed and they are set
// to zero. In addition, fNlayers is set to zero. The destruction of
// TObjArray fShape is, by default, handled by the TObjArray destructor.
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
- if(fGm!=0){
- //for(Int_t i=0;i<fNlayers;i++) delete fGm->At(i);
- fGm->Delete();
- delete fGm;
- } // end if fGm!=0
- if(fNlad!=0) delete[] fNlad;
- if(fNdet!=0) delete[] fNdet;
- fNlayers = 0;
- fNlad = 0;
- fNdet = 0;
- fGm = 0;
- return;
+ return;
}
//______________________________________________________________________
void AliITSgeom::ReadNewFile(const char *filename){
- // It is generaly preferred to define the geometry in AliITSgeom
+ // It is generally preferred to define the geometry in AliITSgeom
// directly from the GEANT geometry, see AliITSvPPRasymm.cxx for
// and example. Under some circumstances this may not be possible.
// This function will read in a formatted file for all of the
// and the order of the data does not need to be completely
// respected. A file can be created using the function WriteNewFile
// defined below.
- // Inputs are:
- // const char *filename The file name of the file to be read in.
- // Outputs are:
- // none
+ // Inputs:
+ // const char *filename The file name of the file to be read in.
+ // Outputs:
+ // none
+ // Return:
+ // none.
Int_t ncmd=9;
const char *cmda[]={"Version" ,"fTrans" ,"fNmodules",
"fNlayers" ,"fNladers","fNdetectors",
"fNDetectorTypes","fShape" ,"Matrix"};
Int_t i,j,lNdetTypes,ldet;
char cmd[20],c;
- AliITSgeomSPD *spd=0;
- AliITSgeomSDD *sdd=0;
- AliITSgeomSSD *ssd=0;
AliITSgeomMatrix *m=0;
ifstream *fp=0;
char *filtmp=0;
+ Bool_t arrayGm = kFALSE, arrayShape = kFALSE;
filtmp = gSystem->ExpandPathName(filename);
AliInfo(Form("Reading New .det file %s",filtmp));
fp = new ifstream(filtmp,ios::in); // open file to write
while(fp->get(c)!=NULL){ // for ever loop
- if(c==' ') continue; // remove blanks
- if(c=='\n') continue;
- if(c=='#' || c=='!') {while(fp->get(c)) if(c=='\n') break; continue;}
- if(c=='/'){
- fp->get(c);{
- if(c=='/') {while(fp->get(c)) if(c=='\n') break; continue;}
- if(c=='*'){
- NotYet:
- while(fp->get(c)) if(c=='*') break;
- fp->get(c);{
- if(c=='/') continue;
- goto NotYet;
- } //
- } // end if c=='*'
- } // end if second /
- } // end if first /
- fp->putback(c);
- *fp >> cmd;
- for(i=0;i<ncmd;i++) if(strcmp(cmd,cmda[i])==0) break;
- switch (i){
- case 0: // Version
- *fp >> fVersion;
- break;
- case 1: // fTrans
- *fp >> fTrans;
- break;
- case 2: // fNModules
- *fp >> fNmodules;
- if(fGm!=0){
- for(j=0;j<fGm->GetEntriesFast();j++) delete fGm->At(j);
- delete fGm;
- } // end if
- fGm = new TObjArray(fNmodules,0);
- break;
- case 3: // fNlayers
- *fp >> fNlayers;
- if(fNlad!=0) delete fNlad;
- if(fNdet!=0) delete fNdet;
- fNlad = new Int_t[fNlayers];
- fNdet = new Int_t[fNlayers];
- break;
- case 4: // fNladers
- for(j=0;j<fNlayers;j++) *fp >> fNlad[j];
- break;
- case 5: // fNdetectors
- for(j=0;j<fNlayers;j++) *fp >> fNdet[j];
- break;
- case 6: // fNDetectorTypes
- *fp >> lNdetTypes;
- if(fShape!=0){
- for(j=0;j<fShape->GetEntriesFast();j++) delete fShape->At(j);
- delete fShape;
+ if(c==' ') continue; // remove blanks
+ if(c=='\n') continue;
+ if(c=='#' || c=='!') {while(fp->get(c)) if(c=='\n') break; continue;}
+ if(c=='/'){
+ fp->get(c);{
+ if(c=='/') {while(fp->get(c)) if(c=='\n') break; continue;}
+ if(c=='*'){
+ NotYet:
+ while(fp->get(c)) if(c=='*') break;
+ fp->get(c);{
+ if(c=='/') continue;
+ goto NotYet;
+ } //
+ } // end if c=='*'
+ } // end if second /
+ } // end if first /
+ fp->putback(c);
+ *fp >> cmd;
+ for(i=0;i<ncmd;i++) if(strcmp(cmd,cmda[i])==0) break;
+ switch (i){
+ case 0: // Version
+ *fp >> j;
+ fVersion.Resize(j);
+ for(j=0;j<fVersion.Length();j++) *fp >> fVersion[j];
+ break;
+ case 1: // fTrans
+ *fp >> fTrans;
+ break;
+ case 2: // fNModules
+ *fp >> fNmodules;
+ fGm.Clear();
+ fGm.Expand(fNmodules);
+ fGm.SetOwner(kTRUE);
+ arrayGm = kTRUE;
+ break;
+ case 3: // fNlayers
+ *fp >> fNlayers;
+ fNlad.Set(fNlayers);
+ fNdet.Set(fNlayers);
+ break;
+ case 4: // fNladers
+ for(j=0;j<fNlayers;j++) *fp >> fNlad[j];
+ break;
+ case 5: // fNdetectors
+ for(j=0;j<fNlayers;j++) *fp >> fNdet[j];
+ break;
+ case 6: // fNDetectorTypes
+ *fp >> lNdetTypes;
+ fShape.Clear();
+ fShape.Expand(lNdetTypes);
+ fShape.SetOwner(kTRUE);
+ arrayShape = kTRUE;
+ break;
+ case 7: // fShape
+ *fp >> ldet;
+ if(!arrayShape) fShape.Expand(5);
+ fShape.SetOwner(kTRUE);
+ switch (ldet){
+ case kSPD :{
+ AliITSgeomSPD *spd = new AliITSgeomSPD();
+ *fp >> *spd;
+ ReSetShape(ldet,spd);
+ } break;
+ case kSDD : case kSDDp:{
+ AliITSgeomSDD *sdd = new AliITSgeomSDD();
+ *fp >> *sdd;
+ ReSetShape(ldet,sdd);
+ }break;
+ case kSSD : case kSSDp :{
+ AliITSgeomSSD *ssd = new AliITSgeomSSD();
+ *fp >> *ssd;
+ ReSetShape(ldet,ssd);
+ }break;
+ default:{
+ AliError(Form("Unknown fShape type number=%d c=%c",ldet,c));
+ while(fp->get(c)) if(c=='\n') break; // skip to end of line.
+ }break;
+ } // end switch
+ break;
+ case 8: // Matrix
+ *fp >> ldet;
+ if(!arrayGm){
+ fGm.Clear();
+ fGm.Expand(2270);
+ arrayGm = kTRUE;
+ } // end if
+ if(ldet<0||ldet>=fGm.GetSize()){
+ Error("ReadNewFile","ldet<0||ldet>=fGm.GetSize()=%d",
+ ldet,fGm.GetSize());
+ return;
} // end if
- fShape = new TObjArray(lNdetTypes,0);
- break;
- case 7: // fShape
- *fp >> ldet;
- if(fShape==0) fShape = new TObjArray(5,0);
- switch (ldet){
- case kSPD :
- spd = new AliITSgeomSPD();
- *fp >> *spd;
- ReSetShape(ldet,spd);
- spd = 0;
- break;
- case kSDD : case kSDDp:
- sdd = new AliITSgeomSDD();
- *fp >> *sdd;
- ReSetShape(ldet,sdd);
- sdd = 0;
- break;
- case kSSD : case kSSDp :
- ssd = new AliITSgeomSSD();
- *fp >> *ssd;
- ReSetShape(ldet,ssd);
- ssd = 0;
- break;
- default:
- AliError(Form("Unknown fShape type number=%d c=%c",ldet,c));
- while(fp->get(c)) if(c=='\n') break; // skip to end of line.
- break;
- } // end switch
- break;
- case 8: // Matrix
- *fp >> ldet;
- if(fGm==0) fGm = new TObjArray(2270,0);
- if(fGm->At(ldet)!=0) delete (fGm->At(ldet));
- fGm->AddAt((TObject*)new AliITSgeomMatrix(),ldet);
- m = (AliITSgeomMatrix*) fGm->At(ldet);
- *fp >> *m;
- m = 0;
- break;
- default:
- AliError(Form("ReadNewFile","Data line i=%d c=%c",i,c));
- while(fp->get(c)) if(c=='\n') break; // skip this line
- break;
- } // end switch i
+ delete fGm.At(ldet);
+ fGm.AddAt((TObject*)new AliITSgeomMatrix(),ldet);
+ m = (AliITSgeomMatrix*) fGm.At(ldet);
+ *fp >> *m;
+ m = 0;
+ break;
+ default:
+ AliError(Form("ReadNewFile","Data line i=%d c=%c",i,c));
+ while(fp->get(c)) if(c=='\n') break; // skip this line
+ break;
+ } // end switch i
} // end while
delete fp;
}
//______________________________________________________________________
void AliITSgeom::WriteNewFile(const char *filename){
- // Writes AliITSgeom, AliITSgeomMatrix, and the defined AliITSgeomS*D
- // classes to a file in a format that is more readable and commendable.
- // Inputs are:
- // const char *filename The file name of the file to be write to.
- // Outputs are:
- // none
+ // Writes AliITSgeom, AliITSgeomMatrix, and the defined
+ // AliITSgeomS*D classes to a file in a format that
+ // is more readable and commendable.
+ // Inputs:
+ // const char *filename The file name of the file to be write to.
+ // Outputs:
+ // none
+ // Return:
+ // none
ofstream *fp;
Int_t i;
char *filtmp;
filtmp = gSystem->ExpandPathName(filename);
- cout << "AliITSgeom, Writing New .det file " << filtmp << endl;
fp = new ofstream(filtmp,ios::out); // open file to write
*fp << "//Comment lines begin with two //, one #, or one !" << endl;
*fp << "#Blank lines are skipped including /* and */ sections." << endl;
*fp << ", kSDD=" << (Int_t) kSDD << ", kSSD=" << (Int_t) kSSD;
*fp << ", kSSDp=" << (Int_t) kSSDp << ", and kSDDp=" << (Int_t) kSDDp;
*fp << "*/" << endl;
- *fp << "Version " << fVersion << endl;//This should be consistent with the
- // geometry version.
+ *fp << "Version "<< fVersion.Length()<<" " << fVersion.Data() << endl;//This should be consistent
+ // with the geometry version.
*fp << "fTrans " << fTrans << endl;
*fp << "fNmodules " << fNmodules << endl;
*fp << "fNlayers " << fNlayers << endl;
*fp << "fNdetectors ";
for(i=0;i<fNlayers;i++) *fp << fNdet[i] << " ";
*fp << endl;
- *fp << "fNDetectorTypes " << fShape->GetEntriesFast() << endl;
- for(i=0;i<fShape->GetEntriesFast();i++){
+ *fp << "fNDetectorTypes " << fShape.GetEntriesFast() << endl;
+ for(i=0;i<fShape.GetEntriesFast();i++){
if(!IsShapeDefined(i)) continue; // only print out used shapes.
switch (i){
case kSPD :
*fp << "fShape " << (Int_t) kSPD << " ";
- *fp << *((AliITSgeomSPD*)(fShape->At(i)));
+ *fp << *((AliITSgeomSPD*)(fShape.At(i)));
break;
case kSDD :
*fp << "fShape " << (Int_t) kSDD << " ";
- *fp << *((AliITSgeomSDD*)(fShape->At(i)));
+ *fp << *((AliITSgeomSDD*)(fShape.At(i)));
break;
case kSSD : case kSSDp :
*fp << "fShape " << i << " ";
- *fp << *((AliITSgeomSSD*)(fShape->At(i)));
+ *fp << *((AliITSgeomSSD*)(fShape.At(i)));
break;
default:
Error("AliITSgeom::WriteNewFile","Unknown Shape value");
return;
}
//______________________________________________________________________
-AliITSgeom::AliITSgeom(const char *filename){
+AliITSgeom::AliITSgeom(const char *filename):
+TObject(),
+fVersion("test"),// Transformation version.
+fTrans(0), // Flag to keep track of which transformation
+fNmodules(0), // The total number of modules
+fNlayers(0), // The number of layers.
+fNlad(), // TArrayI of the number of ladders/layer(layer)
+fNdet(), // TArrayI of the number of detector/ladder(layer)
+fGm(0,0), // TObjArray Structure of translation. and rotation.
+fShape(0,0) // TObjArray of detector geom.
+{
// The constructor for the AliITSgeom class. All of the data to fill
// this structure is read in from the file given my the input filename.
- // Inputs are:
- // const char *filename The file name of the file to be read in.
- // Outputs are:
- // none
+ // Inputs:
+ // const char *filename The file name of the file to be read in.
+ // Outputs:
+ // none
+ // Return:
+ // An AliITSgeom class initialized from a file.
FILE *pf=0;
Int_t i,lm=0,id[3];
Int_t l,a,d;
Float_t x,y,z,o,p,q,r,s,t;
Double_t rot6[6],tran[3];
char buf[200],*buff=0; // input character buffer;
- char *filtmp;
+ char *filtmp;
filtmp = gSystem->ExpandPathName(filename);
- cout << "AliITSgeom reading old .det file " << filtmp << endl;
- fShape = 0;
- strcpy(fVersion,"DefauleV5");
+ Info("AliITSgeom","reading old .det file %s",filtmp);
+ fVersion="GEANT5";
pf = fopen(filtmp,"r");
fNlayers = 6; // set default number of ladders
- TryAgain:
- fNlad = new Int_t[fNlayers];
- fNdet = new Int_t[fNlayers];
+ TryAgain:
+ fNlad.Set(fNlayers);
+ fNdet.Set(fNlayers);
fNmodules = 0;
// find the number of ladders and detectors in this geometry.
for(i=0;i<fNlayers;i++){fNlad[i]=fNdet[i]=0;} // zero out arrays
while(fgets(buf,200,pf)!=NULL){ // for ever loop
- for(i=0;i<200;i++)if(buf[i]!=' '){ // remove blank spaces.
- buff = &(buf[i]);
- break;
- } // end for i
- // remove blank lines and comments.
- if(buff[0]=='\n'||buff[0]=='#'||buff[0]=='!'||
- (buff[0]=='/'&&buff[1]=='/')) continue;
- if(isalpha(buff[0])) { // must be the new file formated file.
+ for(i=0;i<200;i++)if(buf[i]!=' '){ // remove blank spaces.
+ buff = &(buf[i]);
+ break;
+ } // end for i
+ // remove blank lines and comments.
+ if(buff[0]=='\n'||buff[0]=='#'||buff[0]=='!'||
+ (buff[0]=='/'&&buff[1]=='/')) continue;
+ if(isalpha(buff[0])) { // must be the new file formated file.
fclose(pf);
- delete[] fNlad;delete[] fNdet;
ReadNewFile(filename);
return;
- } // end if isalpha(buff[0])
- sscanf(buff,"%d %d %d %f %f %f %f %f %f %f %f %f",
- &l,&a,&d,&x,&y,&z,&o,&p,&q,&r,&s,&t);
- if(l>lm) lm = l;
- if(l<1 || l>fNlayers) {
- printf("error in file %s layer=%d min. is 1 max is %d\n",
- filename,l,fNlayers);
- continue;
- }// end if l
- fNmodules++;
- if(l<=fNlayers&&fNlad[l-1]<a) fNlad[l-1] = a;
- if(l<=fNlayers&&fNdet[l-1]<d) fNdet[l-1] = d;
+ } // end if isalpha(buff[0])
+ sscanf(buff,"%d %d %d %f %f %f %f %f %f %f %f %f",
+ &l,&a,&d,&x,&y,&z,&o,&p,&q,&r,&s,&t);
+ if(l>lm) lm = l;
+ if(l<1 || l>fNlayers) {
+ printf("error in file %s layer=%d min. is 1 max is %d\n",
+ filename,l,fNlayers);
+ continue;
+ }// end if l
+ fNmodules++;
+ if(l<=fNlayers&&fNlad[l-1]<a) fNlad[l-1] = a;
+ if(l<=fNlayers&&fNdet[l-1]<d) fNdet[l-1] = d;
} // end while ever loop
if(lm>fNlayers){
- delete[] fNlad;
- delete[] fNdet;
- fNlayers = lm;
- goto TryAgain;
+ fNlayers = lm;
+ goto TryAgain;
} // end if lm>fNlayers
// counted the number of ladders and detectors now allocate space.
- fGm = new TObjArray(fNmodules,0);
+ fGm.Expand(fNmodules);
+ fGm.SetOwner(kTRUE);
+ fShape.SetOwner(kTRUE);
// Set up Shapes for a default configuration of 6 layers.
fTrans = 0; // standard GEANT global/local coordinate system.
lm = 0; // reuse lm as counter of modules.
rewind(pf); // start over reading file
while(fgets(buf,200,pf)!=NULL){ // for ever loop
- for(i=0;i<200;i++)if(buf[i]!=' '){ // remove blank spaces.
- buff = &(buf[i]);
- break;
- } // end for i
- // remove blank lines and comments.
- if(buff[0]=='\n'||buff[0]=='#'||buff[0]=='!'||
- (buff[0]=='/'&&buff[1]=='/')) continue;
- x = y = z = o = p = q = r = s = t = 0.0;
- sscanf(buff,"%d %d %d %f %f %f %f %f %f %f %f %f",
- &l,&a,&d,&x,&y,&z,&o,&p,&q,&r,&s,&t);
- if(l<1 || l>fNlayers) {
- printf("error in file %s layer=%d min. is 1 max is %d/n",
- filename,l,fNlayers);
- continue;
- }// end if l
- id[0] = l;id[1] = a;id[2] = d;
- tran[0] = tran[1] = tran[2] = 0.0;
- tran[0] = (Double_t)x;tran[1] = (Double_t)y;tran[2] = (Double_t)z;
- rot6[0] = rot6[1] = rot6[2] = rot6[3] = rot6[4] = rot6[5] =0.0;
- rot6[0] = (Double_t)o;rot6[1] = (Double_t)p;rot6[2] = (Double_t)q;
- rot6[3] = (Double_t)r;rot6[4] = (Double_t)s;rot6[5] = (Double_t)t;
- switch (l){
- case 1: case 2: // layer 1 or2 SPD
- fGm->AddAt(new AliITSgeomMatrix(rot6,kSPD,id,tran),lm++);
- break;
- case 3: case 4: // layer 3 or 4 SDD
- fGm->AddAt(new AliITSgeomMatrix(rot6,kSDD,id,tran),lm++);
- break;
- case 5: case 6: // layer 5 or 6 SSD
- fGm->AddAt(new AliITSgeomMatrix(rot6,kSSD,id,tran),lm++);
- break;
- } // end switch
+ for(i=0;i<200;i++)if(buf[i]!=' '){ // remove blank spaces.
+ buff = &(buf[i]);
+ break;
+ } // end for i
+ // remove blank lines and comments.
+ if(buff[0]=='\n'||buff[0]=='#'||buff[0]=='!'||
+ (buff[0]=='/'&&buff[1]=='/')) continue;
+ x = y = z = o = p = q = r = s = t = 0.0;
+ sscanf(buff,"%d %d %d %f %f %f %f %f %f %f %f %f",
+ &l,&a,&d,&x,&y,&z,&o,&p,&q,&r,&s,&t);
+ if(l<1 || l>fNlayers) {
+ Warning("AliITSgeom","error in file %s layer=%d min. is 1 max is %d",
+ filename,l,fNlayers);
+ continue;
+ }// end if l
+ id[0] = l;id[1] = a;id[2] = d;
+ tran[0] = tran[1] = tran[2] = 0.0;
+ tran[0] = (Double_t)x;tran[1] = (Double_t)y;tran[2] = (Double_t)z;
+ rot6[0] = rot6[1] = rot6[2] = rot6[3] = rot6[4] = rot6[5] =0.0;
+ rot6[0] = (Double_t)o;rot6[1] = (Double_t)p;rot6[2] = (Double_t)q;
+ rot6[3] = (Double_t)r;rot6[4] = (Double_t)s;rot6[5] = (Double_t)t;
+ if(lm<0||lm>=fGm.GetSize()){
+ Error("AliITSgeom(filename)","lm<0||lm>=fGm.GetSize()=%d",
+ lm,fGm.GetSize());
+ return;
+ } // end if
+ switch (l){
+ case 1: case 2: // layer 1 or2 SPD
+ fGm.AddAt(new AliITSgeomMatrix(rot6,kSPD,id,tran),lm++);
+ break;
+ case 3: case 4: // layer 3 or 4 SDD
+ fGm.AddAt(new AliITSgeomMatrix(rot6,kSDD,id,tran),lm++);
+ break;
+ case 5: case 6: // layer 5 or 6 SSD
+ fGm.AddAt(new AliITSgeomMatrix(rot6,kSSD,id,tran),lm++);
+ break;
+ } // end switch
} // end while ever loop
fclose(pf);
}
AliITSgeom::AliITSgeom(const AliITSgeom &source) : TObject(source){
// The copy constructor for the AliITSgeom class. It calls the
// = operator function. See the = operator function for more details.
- // Inputs are:
- // AliITSgeom &source The AliITSgeom class with which to make this
- // a copy of.
- // Outputs are:
- // none.
+ // Inputs:
+ // AliITSgeom &source The AliITSgeom class with which to make this
+ // a copy of.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
*this = source; // Just use the = operator for now.
return;
// to the copied class will not affect the source class in any way.
// This is required for many ITS alignment studies where the copied
// class is then modified by introducing some misalignment.
- // Inputs are:
- // AliITSgeom &source The AliITSgeom class with which to make this
- // a copy of.
- // Outputs are:
- // return *this The a new copy of source.
- Int_t i;
+ // Inputs:
+ // AliITSgeom &source The AliITSgeom class with which to make this
+ // a copy of.
+ // Outputs:
+ // none.
+ // Return:
+ // *this The a new copy of source.
+ Int_t i;
- if(this == &source) return *this; // don't assign to ones self.
+ if(this == &source) return *this; // don't assign to ones self.
- // if there is an old structure allocated delete it first.
- if(this->fGm != 0){
- for(i=0;i<this->fNmodules;i++) delete this->fGm->At(i);
- delete this->fGm;
- } // end if fGm != 0
- if(fNlad != 0) delete[] fNlad;
- if(fNdet != 0) delete[] fNdet;
+ // if there is an old structure allocated delete it first.
+ this->fGm.Clear();
+ this->fShape.Clear();
- this->fTrans = source.fTrans;
- this->fNmodules = source.fNmodules;
- this->fNlayers = source.fNlayers;
- this->fNlad = new Int_t[fNlayers];
- for(i=0;i<this->fNlayers;i++) this->fNlad[i] = source.fNlad[i];
- this->fNdet = new Int_t[fNlayers];
- for(i=0;i<this->fNlayers;i++) this->fNdet[i] = source.fNdet[i];
- this->fShape = new TObjArray(*(source.fShape));//This does not make a proper copy.
- this->fGm = new TObjArray(this->fNmodules,0);
- for(i=0;i<this->fNmodules;i++){
- this->fGm->AddAt(new AliITSgeomMatrix(*(
- (AliITSgeomMatrix*)(source.fGm->At(i)))),i);
- } // end for i
- return *this;
+ this->fVersion = source.fVersion;
+ this->fTrans = source.fTrans;
+ this->fNmodules = source.fNmodules;
+ this->fNlayers = source.fNlayers;
+ this->fNlad.Set(fNlayers,source.fNlad.GetArray());
+ this->fNdet.Set(fNlayers,source.fNdet.GetArray());
+ this->fShape.Expand(source.fShape.GetEntriesFast());
+ for(i=0;i<source.fShape.GetEntriesFast();i++)
+ this->fShape.AddAt(new TObject(*(source.fShape.At(i))),i);
+ this->fShape.SetOwner(kTRUE);
+ this->fGm.Expand(this->fNmodules);
+ this->fGm.SetOwner(kTRUE);
+ for(i=0;i<this->fNmodules;i++)
+ if(i<0||i>=fGm.GetSize()){
+ Error("ReadNewFile","i<0||i>=fGm.GetSize()=%d",
+ i,fGm.GetSize());
+ return *this;
+ } // end if
+ this->fGm.AddAt(new TObject(*(source.fGm.At(i))),i);
+ return *this;
}
//______________________________________________________________________
Int_t AliITSgeom::GetModuleIndex(Int_t lay,Int_t lad,Int_t det){
// ladder, and detector numbers. The number of ladders and detectors
// per layer is determined when this geometry package is constructed,
// see AliITSgeom(const char *filename) for specifics.
- // Inputs are:
- // Int_t lay The layer number. Starting from 1.
- // Int_t lad The ladder number. Starting from 1.
- // Int_t det The detector number. Starting from 1.
- // Outputs are:
- // return the module index number, starting from zero.
+ // Inputs:
+ // Int_t lay The layer number. Starting from 1.
+ // Int_t lad The ladder number. Starting from 1.
+ // Int_t det The detector number. Starting from 1.
+ // Outputs:
+ // none.
+ // Return:
+ // the module index number, starting from zero.
Int_t i,j,k,id[3];
i = fNdet[lay-1] * (lad-1) + det - 1;
if(id[0]==lay&&id[1]==lad&&id[2]==det) return i;
// Array of modules fGm is not in expected order. Search for this index
for(i=0;i<fNmodules;i++){
- GetGeomMatrix(i)->GetIndex(id);
- if(id[0]==lay&&id[1]==lad&&id[2]==det) return i;
+ GetGeomMatrix(i)->GetIndex(id);
+ if(id[0]==lay&&id[1]==lad&&id[2]==det) return i;
} // end for i
// This layer ladder and detector combination does not exist return -1.
return -1;
// given the module index number. The number of ladders and detectors
// per layer is determined when this geometry package is constructed,
// see AliITSgeom(const char *filename) for specifics.
- // Inputs are:
- // Int_t index The module index number, starting from zero.
- // Outputs are:
- // Int_t lay The layer number. Starting from 1.
- // Int_t lad The ladder number. Starting from 1.
- // Int_t det The detector number. Starting from 1.
+ // Inputs:
+ // Int_t index The module index number, starting from zero.
+ // Outputs:
+ // Int_t lay The layer number. Starting from 1.
+ // Int_t lad The ladder number. Starting from 1.
+ // Int_t det The detector number. Starting from 1.
+ // Return:
+ // none.
Int_t id[3];
AliITSgeomMatrix *g = GetGeomMatrix(index);
- if (g == 0x0)
- {
- Error("GetModuleId","Can not get GeoMatrix for index = %d",index);
- lay = -1; lad = -1; det = -1;
- }
- else
- {
- g->GetIndex(id);
- lay = id[0]; lad = id[1]; det = id[2];
- }
- return;
+ if (g == 0x0){
+ Error("GetModuleId","Can not get GeoMatrix for index = %d",index);
+ lay = -1; lad = -1; det = -1;
+ }else{
+ g->GetIndex(id);
+ lay = id[0]; lad = id[1]; det = id[2];
+ }// End if
+ return;
// The old way kept for posterity.
/*
Int_t i,j,k;
*/
}
//______________________________________________________________________
+Int_t AliITSgeom::GetNDetTypes(Int_t &max){
+ // Finds and returns the number of detector types used and the
+ // maximum detector type value. Only counts id >=0 (no undefined
+ // values. See AliITSgeom.h for list of AliITSDetecor enumerated types.
+ // Inputs:
+ // none.
+ // Outputs:
+ // The maximum detector type used
+ // Return:
+ // The number of detector types used
+ Int_t i,*n,id;
+
+ max = -1;
+ for(i=0;i<GetIndexMax();i++){
+ id = GetModuleType(i);
+ if(id>max) max=id;
+ } // end for i
+ n = new Int_t[max+1];
+ for(i=0;i<max;i++) n[i] = 0;
+ for(i=0;i<GetIndexMax();i++){
+ id = GetModuleType(i);
+ if(id>-1)n[id]++; // note id=-1 => undefined.
+ } // end for i
+ id = 0;
+ for(i=0;i<max;i++) if(n[i]!=0) id++;
+ delete[] n;
+ return id+1;
+}
+//______________________________________________________________________
+Int_t AliITSgeom::GetNDetTypes(TArrayI &maxs,AliITSDetector *types){
+ // Finds and returns the number of detector types used and the
+ // number of each detector type. Only counts id >=0 (no undefined
+ // values. See AliITSgeom.h for list of AliITSDetecor enumerated types.
+ // Inputs:
+ // none.
+ // Outputs:
+ // The maximum detector type used
+ // Return:
+ // The number of detector types used
+ Int_t i,j,*n,id,max;
+
+ max = -1;
+ for(i=0;i<GetIndexMax();i++){
+ id = GetModuleType(i);
+ if(id>max) max=id;
+ } // end for i
+ n = new Int_t[max+1];
+ for(i=0;i<max;i++) n[i] = 0;
+ for(i=0;i<GetIndexMax();i++){
+ id = GetModuleType(i);
+ if(id>-1)n[id]++; // note id=-1 => undefined.
+ } // end for i
+ id = 0;
+ for(i=0;i<=max;i++) if(n[i]!=0) id++;
+ maxs.Set(id);
+ j = 0;
+ for(i=0;i<=max;i++) if(n[i]!=0){
+ maxs[j] = n[i];
+ types[j++] = (AliITSDetector) i;
+ } // end for i/end if
+ delete[] n;
+ return id;
+}
+//______________________________________________________________________
Int_t AliITSgeom::GetStartDet(Int_t dtype){
// returns the starting module index value for a give type of detector id.
// This assumes that the detector types are different on different layers
// and that they are not mixed up.
- // Inputs are:
- // Int_t dtype A detector type number. 0 for SPD, 1 for SDD, and 2 for SSD.
- // outputs:
- // return the module index for the first occurance of that detector type.
+ // Inputs:
+ // Int_t dtype A detector type number. 0 for SPD, 1 for SDD, and 2 for SSD.
+ // Outputs:
+ // none.
+ // Return:
+ // the module index for the first occurrence of that detector type.
switch(dtype){
case 0:
- return GetModuleIndex(1,1,1);
- break;
+ return GetModuleIndex(1,1,1);
+ break;
case 1:
- return GetModuleIndex(3,1,1);
- break;
+ return GetModuleIndex(3,1,1);
+ break;
case 2:
- return GetModuleIndex(5,1,1);
- break;
+ return GetModuleIndex(5,1,1);
+ break;
default:
- Warning("GetStartDet","undefined detector type %d",dtype);
- return 0;
+ Warning("GetStartDet","undefined detector type %d",dtype);
+ return 0;
} // end switch
Warning("GetStartDet","undefined detector type %d",dtype);
// returns the last module index value for a give type of detector id.
// This assumes that the detector types are different on different layers
// and that they are not mixed up.
- // Inputs are:
- // Int_t dtype A detector type number. 0 for SPD, 1 for SDD, and 2 for SSD.
- // outputs are:
- // return the module index for the last occurance of that detector type.
+ // Inputs:
+ // Int_t dtype A detector type number. 0 for SPD, 1 for SDD, and 2 for SSD.
+ // Outputs:
+ // Return:
+ // the module index for the last occurrence of that detector type.
switch(dtype){
case 0:
- return GetLastSPD();
- break;
+ return GetLastSPD();
+ break;
case 1:
- return GetLastSDD();
- break;
+ return GetLastSDD();
+ break;
case 2:
- return GetLastSSD();
- break;
+ return GetLastSSD();
+ break;
default:
- Warning("GetLastDet","undefined detector type %d",dtype);
- return 0;
+ Warning("GetLastDet","undefined detector type %d",dtype);
+ return 0;
} // end switch
Warning("GetLastDet","undefined detector type %d",dtype);
void AliITSgeom::PrintComparison(FILE *fp,AliITSgeom *other){
// This function was primarily created for diagnostic reasons. It
// print to a file pointed to by the file pointer fp the difference
- // between two AliITSgeom classes. The format of the file is basicly,
+ // between two AliITSgeom classes. The format of the file is basically,
// define d? to be the difference between the same element of the two
// classes. For example dfrx = this->GetGeomMatrix(i)->frx
// - other->GetGeomMatrix(i)->frx.
// printed out and it is usually easier to read them in some nice editor
// rather than zooming quickly past you on a screen. fprintf is used to
// do the printing. The fShapeIndex difference is not printed at this time.
- // Inputs are:
- // FILE *fp A file pointer to an opened file for writing in which
- // the results of the comparison will be written.
- // AliITSgeom *other The other AliITSgeom class to which this one is
- // being compared.
- // outputs are:
- // none
+ // Inputs:
+ // FILE *fp A file pointer to an opened file for writing in which
+ // the results of the comparison will be written.
+ // AliITSgeom *other The other AliITSgeom class to which this one is
+ // being compared.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
Int_t i,j,idt[3],ido[3];
Double_t tt[3],to[3]; // translation
Double_t rt[3],ro[3]; // phi in radians
- Double_t mt[3][3],mo[3][3]; // matrixes
+ Double_t mt[3][3],mo[3][3]; // matrices
AliITSgeomMatrix *gt,*go;
Bool_t t;
for(i=0;i<this->fNmodules;i++){
- gt = this->GetGeomMatrix(i);
- go = other->GetGeomMatrix(i);
- gt->GetIndex(idt);
- go->GetIndex(ido);
- t = kFALSE;
- for(i=0;i<3;i++) t = t&&idt[i]!=ido[i];
- if(t) fprintf(fp,"%4.4d %1.1d %2.2d %2.2d %1.1d %2.2d %2.2d\n",i,
- idt[0],idt[1],idt[2],ido[0],ido[1],ido[2]);
- gt->GetTranslation(tt);
- go->GetTranslation(to);
- gt->GetAngles(rt);
- go->GetAngles(ro);
- t = kFALSE;
- for(i=0;i<3;i++) t = t&&tt[i]!=to[i];
- if(t) fprintf(fp,"%1.1d %2.2d %2.2d dTrans=%f %f %f drot=%f %f %f\n",
- idt[0],idt[1],idt[2],
- tt[0]-to[0],tt[1]-to[1],tt[2]-to[2],
- rt[0]-ro[0],rt[1]-ro[1],rt[2]-ro[2]);
- t = kFALSE;
- gt->GetMatrix(mt);
- go->GetMatrix(mo);
- for(i=0;i<3;i++)for(j=0;j<3;j++) t = mt[i][j] != mo[i][j];
- if(t){
- fprintf(fp,"%1.1d %2.2d %2.2d dfr= %e %e %e\n",
- idt[0],idt[1],idt[2],
- mt[0][0]-mo[0][0],mt[0][1]-mo[0][1],mt[0][2]-mo[0][2]);
- fprintf(fp," dfr= %e %e %e\n",
- mt[1][0]-mo[1][0],mt[1][1]-mo[1][1],mt[1][2]-mo[1][2]);
- fprintf(fp," dfr= %e %e %e\n",
- mt[2][0]-mo[2][0],mt[2][1]-mo[2][1],mt[2][2]-mo[2][2]);
- } // end if t
+ gt = this->GetGeomMatrix(i);
+ go = other->GetGeomMatrix(i);
+ gt->GetIndex(idt);
+ go->GetIndex(ido);
+ t = kFALSE;
+ for(i=0;i<3;i++) t = t&&idt[i]!=ido[i];
+ if(t) fprintf(fp,"%4.4d %1.1d %2.2d %2.2d %1.1d %2.2d %2.2d\n",i,
+ idt[0],idt[1],idt[2],ido[0],ido[1],ido[2]);
+ gt->GetTranslation(tt);
+ go->GetTranslation(to);
+ gt->GetAngles(rt);
+ go->GetAngles(ro);
+ t = kFALSE;
+ for(i=0;i<3;i++) t = t&&tt[i]!=to[i];
+ if(t) fprintf(fp,"%1.1d %2.2d %2.2d dTrans=%f %f %f drot=%f %f %f\n",
+ idt[0],idt[1],idt[2],
+ tt[0]-to[0],tt[1]-to[1],tt[2]-to[2],
+ rt[0]-ro[0],rt[1]-ro[1],rt[2]-ro[2]);
+ t = kFALSE;
+ gt->GetMatrix(mt);
+ go->GetMatrix(mo);
+ for(i=0;i<3;i++)for(j=0;j<3;j++) t = mt[i][j] != mo[i][j];
+ if(t){
+ fprintf(fp,"%1.1d %2.2d %2.2d dfr= %e %e %e\n",
+ idt[0],idt[1],idt[2],
+ mt[0][0]-mo[0][0],mt[0][1]-mo[0][1],mt[0][2]-mo[0][2]);
+ fprintf(fp," dfr= %e %e %e\n",
+ mt[1][0]-mo[1][0],mt[1][1]-mo[1][1],mt[1][2]-mo[1][2]);
+ fprintf(fp," dfr= %e %e %e\n",
+ mt[2][0]-mo[2][0],mt[2][1]-mo[2][1],mt[2][2]-mo[2][2]);
+ } // end if t
} // end for i
return;
}
// By indicating which detector, some control over the information
// is given to the user. The output it written to the file pointed
// to by the file pointer fp. This can be set to stdout if you want.
- // Inputs are:
- // FILE *fp A file pointer to an opened file for writing in which
- // the results of the comparison will be written.
- // Int_t lay The layer number. Starting from 1.
- // Int_t lad The ladder number. Starting from 1.
- // Int_t det The detector number. Starting from 1.
- // outputs are:
- // none
+ // Inputs:
+ // FILE *fp A file pointer to an opened file for writing in which
+ // the results of the comparison will be written.
+ // Int_t lay The layer number. Starting from 1.
+ // Int_t lad The ladder number. Starting from 1.
+ // Int_t det The detector number. Starting from 1.
+ // Outputs:
+ // none
+ // Return:
+ // none.
AliITSgeomMatrix *gt;
Double_t t[3],r[3],m[3][3];
gt->GetTranslation(t);
gt->GetAngles(r);
fprintf(fp,"%1.1d %2.2d %2.2d Trans=%f %f %f rot=%f %f %f Shape=%d\n",
- lay,lad,det,t[0],t[1],t[2],r[0],r[1],r[2],
- gt->GetDetectorIndex());
+ lay,lad,det,t[0],t[1],t[2],r[0],r[1],r[2],
+ gt->GetDetectorIndex());
gt->GetMatrix(m);
fprintf(fp," dfr= %e %e %e\n",m[0][0],m[0][1],m[0][2]);
fprintf(fp," dfr= %e %e %e\n",m[1][0],m[1][1],m[1][2]);
//______________________________________________________________________
ofstream & AliITSgeom::PrintGeom(ofstream &rb){
// Stream out an object of class AliITSgeom to standard output.
- // Intputs are:
- // ofstream &rb The output streaming buffer.
- // Outputs are:
- // ofstream &rb The output streaming buffer.
- Int_t i;
+ // Intputs:
+ // ofstream &rb The output streaming buffer.
+ // Outputs:
+ // none.
+ // Return:
+ // ofstream &rb The output streaming buffer.
+ Int_t i,nshapes;
rb.setf(ios::scientific);
rb << fTrans << " ";
for(i=0;i<fNlayers;i++) rb << fNlad[i] << " ";
for(i=0;i<fNlayers;i++) rb << fNdet[i] << "\n";
for(i=0;i<fNmodules;i++) {
- rb <<setprecision(16) << *(GetGeomMatrix(i)) << "\n";
+ rb <<setprecision(16) << *(GetGeomMatrix(i)) << "\n";
} // end for i
- rb << fShape->GetEntries()<<endl;
- for(i=0;i<fShape->GetEntries();i++) if(fShape->At(i)!=0) switch (i){
+ nshapes = fShape.GetEntries();
+ rb << nshapes <<endl;
+ for(i=0;i<nshapes;i++) if(fShape.At(i)!=0) switch (i){
case kSPD:
- rb << kSPD <<","<< (AliITSgeomSPD*)(fShape->At(kSPD));
- break;
+ rb << kSPD <<","<< (AliITSgeomSPD*)(fShape.At(kSPD));
+ break;
case kSDD:
- rb << kSDD <<","<< (AliITSgeomSDD*)(fShape->At(kSDD));
- break;
+ rb << kSDD <<","<< (AliITSgeomSDD*)(fShape.At(kSDD));
+ break;
case kSSD:
- rb << kSSD <<","<< (AliITSgeomSSD*)(fShape->At(kSSD));
- break;
+ rb << kSSD <<","<< (AliITSgeomSSD*)(fShape.At(kSSD));
+ break;
case kSSDp:
- rb << kSSDp <<","<< (AliITSgeomSSD*)(fShape->At(kSSDp));
- break;
+ rb << kSSDp <<","<< (AliITSgeomSSD*)(fShape.At(kSSDp));
+ break;
case kSDDp:
- rb << kSDDp <<","<< (AliITSgeomSDD*)(fShape->At(kSDDp));
- break;
+ rb << kSDDp <<","<< (AliITSgeomSDD*)(fShape.At(kSDDp));
+ break;
} // end for i / switch
return rb;
}
//______________________________________________________________________
ifstream & AliITSgeom::ReadGeom(ifstream &rb){
// Stream in an object of class AliITSgeom from standard input.
- // Intputs are:
- // ifstream &rb The input streaming buffer.
- // Outputs are:
- // ifstream &rb The input streaming buffer.
+ // Intputs:
+ // ifstream &rb The input streaming buffer.
+ // Outputs:
+ // none.
+ // Return:
+ // ifstream &rb The input streaming buffer.
Int_t i,j;
- fNlad = new Int_t[fNlayers];
- fNdet = new Int_t[fNlayers];
- if(fGm!=0){
- for(i=0;i<fNmodules;i++) delete GetGeomMatrix(i);
- delete fGm;
- } // end if fGm!=0
+ fGm.Clear();
rb >> fTrans >> fNmodules >> fNlayers;
- fNlad = new Int_t[fNlayers];
- fNdet = new Int_t[fNlayers];
+ fNlad.Set(fNlayers);
+ fNdet.Set(fNlayers);
for(i=0;i<fNlayers;i++) rb >> fNlad[i];
for(i=0;i<fNlayers;i++) rb >> fNdet[i];
- fGm = new TObjArray(fNmodules,0);
+ fGm.Expand(fNmodules);
+ fGm.SetOwner(kTRUE);
for(i=0;i<fNmodules;i++){
- fGm->AddAt(new AliITSgeomMatrix,i);
- rb >> *(GetGeomMatrix(i));
+ if(i<0||i>=fGm.GetSize()){
+ Error("ReadGeom","i<0||i>=fGm.GetSize()=%d",
+ i,fGm.GetSize());
+ return rb;
+ } // end if
+ fGm.AddAt(new AliITSgeomMatrix,i);
+ rb >> *(GetGeomMatrix(i));
} // end for i
rb >> i;
- fShape = new TObjArray(i);
- for(i=0;i<fShape->GetEntries();i++) {
- rb >> j;
- switch (j){
- case kSPD:{
- AliITSgeomSPD *s = new AliITSgeomSPD();
- rb >> *s;
- fShape->AddAt(s,kSPD);}
- break;
- case kSDD:{
- AliITSgeomSDD *s = new AliITSgeomSDD();
- rb >> *s;
- fShape->AddAt(s,kSDD);}
- break;
- case kSSD:{
- AliITSgeomSSD *s = new AliITSgeomSSD();
- rb >> *s;
- fShape->AddAt(s,kSSD);}
- break;
- case kSSDp:{
- AliITSgeomSSD *s = new AliITSgeomSSD();
- rb >> *s;
- fShape->AddAt(s,kSSDp);}
- break;
- case kSDDp:{
- AliITSgeomSDD *s = new AliITSgeomSDD();
- rb >> *s;
- fShape->AddAt(s,kSDDp);}
- break;
- } // end switch
+ fShape.Expand(i);
+ fShape.SetOwner(kTRUE);
+ for(i=0;i<fShape.GetEntries();i++) {
+ rb >> j;
+ switch (j){
+ case kSPD:{
+ AliITSgeomSPD *s = new AliITSgeomSPD();
+ rb >> *s;
+ fShape.AddAt(s,kSPD);}
+ break;
+ case kSDD:{
+ AliITSgeomSDD *s = new AliITSgeomSDD();
+ rb >> *s;
+ fShape.AddAt(s,kSDD);}
+ break;
+ case kSSD:{
+ AliITSgeomSSD *s = new AliITSgeomSSD();
+ rb >> *s;
+ fShape.AddAt(s,kSSD);}
+ break;
+ case kSSDp:{
+ AliITSgeomSSD *s = new AliITSgeomSSD();
+ rb >> *s;
+ fShape.AddAt(s,kSSDp);}
+ break;
+ case kSDDp:{
+ AliITSgeomSDD *s = new AliITSgeomSDD();
+ rb >> *s;
+ fShape.AddAt(s,kSDDp);}
+ break;
+ } // end switch
} // end for i
return rb;
}
// A change in the angles will result in the inclination of the ITS with
// respect to the beam line, except for an effective rotation about the
// beam axis which will just rotate the ITS as a hole about the beam axis.
- // Intputs are:
- // Float_t *tran A 3 element array representing the global translations.
- // the elements are x,y,z in cm.
- // Float_t *rot A 3 element array representing the global rotation
- // angles about the three axis x,y,z in radians
- // Outputs are:
- // none.
+ // Intputs:
+ // Float_t *tran A 3 element array representing the global translations.
+ // the elements are x,y,z in cm.
+ // Float_t *rot A 3 element array representing the global rotation
+ // angles about the three axis x,y,z in radians
+ // Outputs:
+ // none.
+ // Return:
+ // none.
Int_t i,j;
Double_t t[3],r[3];
AliITSgeomMatrix *g;
fTrans = (fTrans && 0xfffd) + 2; // set bit 1 true.
for(i=0;i<fNmodules;i++){
- g = this->GetGeomMatrix(i);
- g->GetTranslation(t);
- g->GetAngles(r);
- for(j=0;j<3;j++){
- t[j] += tran[j];
- r[j] += rot[j];
- } // end for j
- g->SetTranslation(t);
- g->SetAngles(r);
+ g = this->GetGeomMatrix(i);
+ g->GetTranslation(t);
+ g->GetAngles(r);
+ for(j=0;j<3;j++){
+ t[j] += tran[j];
+ r[j] += rot[j];
+ } // end for j
+ g->SetTranslation(t);
+ g->SetAngles(r);
} // end for i
return;
}
// will result in the inclination of the ITS with respect to the beam
// line, except for an effective rotation about the beam axis which will
// just rotate the ITS as a hole about the beam axis.
- // Intputs are:
- // Float_t *tran A 3 element array representing the global translations.
- // the elements are r,theta,z in cm/radians.
- // Float_t *rot A 3 element array representing the global rotation
- // angles about the three axis x,y,z in radians
- // Outputs are:
- // none.
+ // Intputs:
+ // Float_t *tran A 3 element array representing the global translations.
+ // the elements are r,theta,z in cm/radians.
+ // Float_t *rot A 3 element array representing the global rotation
+ // angles about the three axis x,y,z in radians
+ // Outputs:
+ // none.
+ // Return:
+ // none.
Int_t i,j;
Double_t t[3],ro[3],r,r0,phi,rphi;
AliITSgeomMatrix *g;
fTrans = (fTrans && 0xfffd) + 2; // set bit 1 true.
for(i=0;i<fNmodules;i++){
- g = this->GetGeomMatrix(i);
- g->GetTranslation(t);
- g->GetAngles(ro);
- r = r0= TMath::Hypot(t[1],t[0]);
- phi = TMath::ATan2(t[1],t[0]);
- rphi = r0*phi;
- r += tran[0];
- rphi += tran[1];
- phi = rphi/r0;
- t[0] = r*TMath::Cos(phi);
- t[1] = r*TMath::Sin(phi);
- t[2] += tran[2];
- for(j=0;j<3;j++){
- ro[j] += rot[j];
- } // end for j
- g->SetTranslation(t);
- g->SetAngles(ro);
+ g = this->GetGeomMatrix(i);
+ g->GetTranslation(t);
+ g->GetAngles(ro);
+ r = r0= TMath::Hypot(t[1],t[0]);
+ phi = TMath::ATan2(t[1],t[0]);
+ rphi = r0*phi;
+ r += tran[0];
+ rphi += tran[1];
+ phi = rphi/r0;
+ t[0] = r*TMath::Cos(phi);
+ t[1] = r*TMath::Sin(phi);
+ t[2] += tran[2];
+ for(j=0;j<3;j++){
+ ro[j] += rot[j];
+ } // end for j
+ g->SetTranslation(t);
+ g->SetAngles(ro);
} // end for i
return;
}
// is determined by the three element array stran, for the
// x y and z translations, and the three element array srot,
// for the three rotation about the axis x y and z.
- // Intputs are:
- // Float_t *stran A 3 element array representing the global translations
- // variances. The elements are x,y,z in cm.
- // Float_t *srot A 3 element array representing the global rotation
- // angles variances about the three axis x,y,z in radians.
- // Outputs are:
- // none.
+ // Intputs:
+ // Float_t *stran A 3 element array representing the global translations
+ // variances. The elements are x,y,z in cm.
+ // Float_t *srot A 3 element array representing the global rotation
+ // angles variances about the three axis x,y,z in radians.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
Int_t i,j;
Double_t t[3],r[3];
AliITSgeomMatrix *g;
fTrans = (fTrans && 0xfffd) + 2; // set bit 1 true.
for(i=0;i<fNmodules;i++){
- g = this->GetGeomMatrix(i);
- g->GetTranslation(t);
- g->GetAngles(r);
- for(j=0;j<3;j++){
- t[j] += gRandom->Gaus(0.0,stran[j]);
- r[j] += gRandom->Gaus(0.0, srot[j]);
- } // end for j
- g->SetTranslation(t);
- g->SetAngles(r);
+ g = this->GetGeomMatrix(i);
+ g->GetTranslation(t);
+ g->GetAngles(r);
+ for(j=0;j<3;j++){
+ t[j] += gRandom->Gaus(0.0,stran[j]);
+ r[j] += gRandom->Gaus(0.0, srot[j]);
+ } // end for j
+ g->SetTranslation(t);
+ g->SetAngles(r);
} // end for i
return;
}
// for the three rotation about the axis x y and z. This random change
// in detector position allow for the simulation of a random uncertainty
// in the detector positions of the ITS.
- // Intputs are:
- // Float_t *stran A 3 element array representing the global translations
- // variances. The elements are r,theta,z in cm/readians.
- // Float_t *srot A 3 element array representing the global rotation
- // angles variances about the three axis x,y,z in radians.
- // Outputs are:
- // none.
+ // Intputs:
+ // Float_t *stran A 3 element array representing the global translations
+ // variances. The elements are r,theta,z in cm/radians.
+ // Float_t *srot A 3 element array representing the global rotation
+ // angles variances about the three axis x,y,z in radians.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
Int_t i,j;
Double_t t[3],ro[3],r,r0,phi,rphi;
TRandom ran;
fTrans = (fTrans && 0xfffd) + 2; // set bit 1 true.
for(i=0;i<fNmodules;i++){
- g = this->GetGeomMatrix(i);
- g->GetTranslation(t);
- g->GetAngles(ro);
- r = r0= TMath::Hypot(t[1],t[0]);
- phi = TMath::ATan2(t[1],t[0]);
- rphi = r0*phi;
- r += ran.Gaus(0.0,stran[0]);
- rphi += ran.Gaus(0.0,stran[1]);
- phi = rphi/r0;
- t[0] = r*TMath::Cos(phi);
- t[1] = r*TMath::Sin(phi);
- t[2] += ran.Gaus(0.0,stran[2]);
- for(j=0;j<3;j++){
- ro[j] += ran.Gaus(0.0, srot[j]);
- } // end for j
- g->SetTranslation(t);
- g->SetAngles(ro);
+ g = this->GetGeomMatrix(i);
+ g->GetTranslation(t);
+ g->GetAngles(ro);
+ r = r0= TMath::Hypot(t[1],t[0]);
+ phi = TMath::ATan2(t[1],t[0]);
+ rphi = r0*phi;
+ r += ran.Gaus(0.0,stran[0]);
+ rphi += ran.Gaus(0.0,stran[1]);
+ phi = rphi/r0;
+ t[0] = r*TMath::Cos(phi);
+ t[1] = r*TMath::Sin(phi);
+ t[2] += ran.Gaus(0.0,stran[2]);
+ for(j=0;j<3;j++){
+ ro[j] += ran.Gaus(0.0, srot[j]);
+ } // end for j
+ g->SetTranslation(t);
+ g->SetAngles(ro);
} // end for i
return;
}
// ALICE ITS geometry. For tracking the Z axis is left alone but X-> -Y
// and Y-> X such that X always points out of the ITS cylinder for every
// layer including layer 1 (where the detectors are mounted upside down).
- // Inputs are:
- // AliITSgeom &source The AliITSgeom class with which to make this
- // a copy of.
- // Outputs are:
- // return *this The a new copy of source.
//Begin_Html
/*
<img src="picts/ITS/AliITSgeomMatrix_T1.gif">
*/
//End_Html
+ // Input:
+ // AliITSgeom &source The AliITSgeom class with which to make this
+ // a copy of.
+ // Output:
+ // none.
+ // Return:
+ // none.
Int_t i,j,k,l,id[3];
Double_t r0[3][3],r1[3][3];
Double_t a0[3][3] = {{0.,+1.,0.},{-1.,0.,0.},{0.,0.,+1.}};
*this = source; // copy everything
for(i=0;i<GetIndexMax();i++){
- GetGeomMatrix(i)->GetIndex(id);
- GetGeomMatrix(i)->GetMatrix(r0);
- if(id[0]==1){ // Layer 1 is treated different from the others.
- for(j=0;j<3;j++) for(k=0;k<3;k++){
- r1[j][k] = 0.;
- for(l=0;l<3;l++) r1[j][k] += a0[j][l]*r0[l][k];
- } // end for j,k
- }else{
- for(j=0;j<3;j++) for(k=0;k<3;k++){
- r1[j][k] = 0.;
- for(l=0;l<3;l++) r1[j][k] += a1[j][l]*r0[l][k];
- } // end for j,k
- } // end if
- GetGeomMatrix(i)->SetMatrix(r1);
+ GetGeomMatrix(i)->GetIndex(id);
+ GetGeomMatrix(i)->GetMatrix(r0);
+ if(id[0]==1){ // Layer 1 is treated different from the others.
+ for(j=0;j<3;j++) for(k=0;k<3;k++){
+ r1[j][k] = 0.;
+ for(l=0;l<3;l++) r1[j][k] += a0[j][l]*r0[l][k];
+ } // end for j,k
+ }else{
+ for(j=0;j<3;j++) for(k=0;k<3;k++){
+ r1[j][k] = 0.;
+ for(l=0;l<3;l++) r1[j][k] += a1[j][l]*r0[l][k];
+ } // end for j,k
+ } // end if
+ GetGeomMatrix(i)->SetMatrix(r1);
} // end for i
this->fTrans = (this->fTrans && 0xfffe) + 1; // set bit 0 true.
return;
// Finds the Detector (Module) that is nearest the point g [cm] in
// ALICE Global coordinates. If layer !=0 then the search is restricted
// to Detectors (Modules) in that particular layer.
- // Inputs are:
- // Double_t g[3] The ALICE Cartesean global coordinate from which the
- // distance is to be calculated with.
- // Int_t lay The layer to restrict the search to. If layer=0 then
- // all layers are searched. Default is lay=0.
- // Outputs are:
- // return The module number representing the nearest module.
+ // Inputs:
+ // Double_t g[3] The ALICE Cartesian global coordinate from which the
+ // distance is to be calculated with.
+ // Int_t lay The layer to restrict the search to. If layer=0 then
+ // all layers are searched. Default is lay=0.
+ // Output:
+ // none.
+ // Return:
+ // The module number representing the nearest module.
Int_t i,l,a,e,in=0;
Double_t d,dn=1.0e10;
Bool_t t=lay!=0; // skip if lay = 0 default value check all layers.
for(i=0;i<fNmodules;i++){
- if(t){GetModuleId(i,l,a,e);if(l!=lay) continue;}
- if((d=GetGeomMatrix(i)->Distance2(g))<dn){
- dn = d;
- in = i;
- } // end if
+ if(t){GetModuleId(i,l,a,e);if(l!=lay) continue;}
+ if((d=GetGeomMatrix(i)->Distance2(g))<dn){
+ dn = d;
+ in = i;
+ } // end if
} // end for i
return in;
}
// to Detectors (Modules) in that particular layer. The number 27 comes
// from including the nearest detector and all those around it (up, down,
// left, right, forwards, backwards, and the corners).
- // Inputs are:
- // Double_t g[3] The ALICE Cartesean global coordinate from which the
- // distance is to be calculated with.
- // Int_t lay The layer to restrict the search to. If layer=0 then
- // all layers are searched. Default is lay=0.
- // Outputs are:
- // Int_t n[27] The module number representing the nearest 27 modules
- // in order.
+ // Input:
+ // Double_t g[3] The ALICE Cartesian global coordinate from which the
+ // distance is to be calculated with.
+ // Int_t lay The layer to restrict the search to. If layer=0 then
+ // all layers are searched. Default is lay=0.
+ // Output:
+ // Int_t n[27] The module number representing the nearest 27 modules
+ // in order.
+ // Return:
+ // none.
Int_t i,l,a,e,in[27]={0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,};
+ 0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,};
Double_t d,dn[27]={1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
- 1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
- 1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
- 1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
- 1.0e10,1.0e10,1.0e10};
+ 1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
+ 1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
+ 1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
+ 1.0e10,1.0e10,1.0e10};
Bool_t t=(lay!=0); // skip if lay = 0 default value check all layers.
for(i=0;i<fNmodules;i++){
- if(t){GetModuleId(i,l,a,e);if(l!=lay) continue;}
- for(a=0;a<27;a++){
- d = GetGeomMatrix(i)->Distance2(g);
- if(d<dn[a]){
- for(e=26;e>a;e--){dn[e] = dn[e-1];in[e] = in[e-1];}
- dn[a] = d; in[a] = i;
- } // end if d<dn[i]
- } // end for a
+ if(t){GetModuleId(i,l,a,e);if(l!=lay) continue;}
+ for(a=0;a<27;a++){
+ d = GetGeomMatrix(i)->Distance2(g);
+ if(d<dn[a]){
+ for(e=26;e>a;e--){dn[e] = dn[e-1];in[e] = in[e-1];}
+ dn[a] = d; in[a] = i;
+ } // end if d<dn[i]
+ } // end for a
} // end for i
for(i=0;i<27;i++) n[i] = in[i];
}
+//----------------------------------------------------------------------
+Double_t AliITSgeom::GetAverageRadiusOfLayer(Int_t layer,Double_t &range){
+ // Loops over all modules for a given layer and computes the
+ // average cylindrical radius (about the z axis) and the range of
+ // radii covered by this layer. Units, [cm] the Alice default unit.
+ // Input:
+ // Int_t layer The layer for which the average radii is to be found
+ // Output:
+ // Double_t &range The range of radii covered by this layer
+ // Return:
+ // The average radii for this layer.
+ Double_t r=0.0,rmin=1.0e6,rmax=-1.0,rp,t[3],l[3],dl[3];
+ Int_t n=0,i,j,lay,lad,det;
+
+ for(i=0;i<GetIndexMax();i++) {
+ GetModuleId(i,lay,lad,det);
+ if(lay!=layer) continue;
+ dl[0] = dl[1] = dl[2] = 0.0;
+ if(GetShape(i)!=0) {
+ switch(i){
+ case 0:{
+ dl[0] = ((AliITSgeomSPD*)GetShape(i))->GetDx();
+ dl[1] = ((AliITSgeomSPD*)GetShape(i))->GetDy();
+ dl[2] = ((AliITSgeomSPD*)GetShape(i))->GetDz();
+ } break;
+ case 1: case 4:{
+ dl[0] = ((AliITSgeomSDD*)GetShape(i))->GetDx();
+ dl[1] = ((AliITSgeomSDD*)GetShape(i))->GetDy();
+ dl[2] = ((AliITSgeomSDD*)GetShape(i))->GetDz();
+ } break;
+ case 2: case 3:{
+ dl[0] = ((AliITSgeomSSD*)GetShape(i))->GetDx();
+ dl[1] = ((AliITSgeomSSD*)GetShape(i))->GetDy();
+ dl[2] = ((AliITSgeomSSD*)GetShape(i))->GetDz();
+ } break;
+ }// end switch.
+ } // end of
+ n++;
+ GetTransCyln(i,t);
+ rp = t[0];
+ r += rp;
+ if(rmin>rp) rmin = rp;
+ if(rmax<rp) rmax = rp;
+ for(j=0;j<8;j++){ // loop over the corners
+ l[0] = dl[0];if(j%2==0) l[0] = -dl[0];
+ l[1] = dl[1];if(j==2||j==3||j==6||j==7) l[1] = -dl[1];
+ l[2] = dl[2];if(j>3) l[2] = -dl[2];
+ LtoG(i,l,t);
+ rp = TMath::Sqrt(t[0]*t[0]+t[1]*t[1]);
+ if(rmin>rp) rmin = rp;
+ if(rmax<rp) rmax = rp;
+ } // end for j
+ } // end for i
+ r /= (Double_t)n;
+ range = TMath::Max(rmax-r,r-rmin);
+ return r;
+}
//_______________________________________________________________________
void AliITSgeom::DetLToTrackingV2(Int_t md, Float_t xin, Float_t zin, Float_t &yout, Float_t &zout) {
#include <TObject.h>
#include <TObjArray.h>
#include <TVector.h>
+#include <TString.h>
+#include <TArrayI.h>
+class TArrayI;
#include "AliITSgeomMatrix.h"
public:
AliITSgeom(); // Default constructor
AliITSgeom(const char *filename); // Constructor
- AliITSgeom(Int_t itype,Int_t nlayers,Int_t *nlads,Int_t *ndets,
- Int_t nmods); // Constructor
+ AliITSgeom(Int_t itype,Int_t nlayers,const Int_t *nlads,const Int_t *ndets,
+ Int_t nmods); // Constructor
AliITSgeom(const AliITSgeom &source); // Copy constructor
AliITSgeom& operator=(const AliITSgeom &source);// = operator
virtual ~AliITSgeom(); // Default destructor
+ // Zero and reinitilizes this class.
+ void Init(Int_t itype,Int_t nlayers,const Int_t *nlads,
+ const Int_t *ndets,Int_t mods);
// this function allocates a AliITSgeomMatrix for a particular module.
- void CreatMatrix(Int_t mod,Int_t lay,Int_t lad,Int_t det,
- AliITSDetector idet,const Double_t tran[3],
- const Double_t rot[10]);
+ void CreateMatrix(Int_t mod,Int_t lay,Int_t lad,Int_t det,
+ AliITSDetector idet,const Double_t tran[3],
+ const Double_t rot[10]);
void ReadNewFile(const char *filename); // Constructor for new format.
void WriteNewFile(const char *filename); // Output for new format.
-// Getters
+ // Getters
Int_t GetTransformationType() const {return fTrans;}
-//
+ //
// returns kTRUE if the transformation defined by this class is
// for Global GEANT coordinate system to the local GEANT coordinate system
// of the detector. These are the transformation used by GEANT.
Bool_t IsGeantToDisplaced() const {return ((fTrans&&0xfffd)!= 0);}
// returns kTRUE if the shape defined by ishape has been defined in this
// set of transformations. Typical values of ishape are kSPD, kSDD, kSSD,
- // SSD2.
+ // kSSD2.
Bool_t IsShapeDefined(Int_t ishape)const {
- if(fShape!=0){return ((fShape->At(ishape))!=0);}else return kFALSE;}
-//
+ return ((fShape.At(ishape))!=0);}
+ //
// This function returns a pointer to the particular AliITSgeomMatrix
// class for a specific module index.
- AliITSgeomMatrix *GetGeomMatrix(Int_t index){
- return (AliITSgeomMatrix*)(fGm->At(index));}
+ AliITSgeomMatrix *GetGeomMatrix(Int_t index){if(index<fGm.GetSize()&&index>=0)
+ return (AliITSgeomMatrix*)(fGm.At(index));else Error("GetGeomMatrix","index=%d<0||>=GetSize()=%d",index,fGm.GetSize());return 0;}
+ // This function find and return the number of detector types only.
+ Int_t GetNDetTypes(){Int_t max;return GetNDetTypes(max);};
+ // This function find and return the number of detector types and the
+ // maximum det type value.
+ Int_t GetNDetTypes(Int_t &max);
+ // This function finds and return the number of detector types and the
+ // and the number of each type in the TArrayI and their types.
+ Int_t GetNDetTypes(TArrayI &maxs,AliITSDetector *types);
// This function returns the number of detectors/ladder for a give
// layer. In particular it returns fNdet[layer-1].
Int_t GetNdetectors(Int_t lay) const {return fNdet[lay-1];}
// This function returns the module index number given the layer,
// ladder and detector numbers put into the array id[3].
Int_t GetModuleIndex(const Int_t *id){
- return GetModuleIndex(id[0],id[1],id[2]);}
+ return GetModuleIndex(id[0],id[1],id[2]);}
void GetModuleId(Int_t index,Int_t &lay,Int_t &lad,Int_t &det);
// Returns the detector type
Int_t GetModuleType(Int_t index){
- return GetGeomMatrix(index)->GetDetectorIndex();}
+ return GetGeomMatrix(index)->GetDetectorIndex();}
// Returns the detector type as a string
- const char * GetModuleTypeName(Int_t index){switch(GetModuleType(index)) {
- case kSPD: return "kSPD";case kSDD: return "kSDD";case kSSD: return "kSSD";
- case kSSDp: return"kSSDp";case kSDDp: return "kSDDp"; default: return "";}}
-//
+ const char * GetModuleTypeName(Int_t index){
+ return GetDetectorTypeName(GetModuleType(index));}
+ // Returns the detector type as a string
+ const char * GetDetectorTypeName(Int_t index){switch(index) {
+ case kSPD : return "kSPD" ; case kSDD : return "kSDD" ;
+ case kSSD : return "kSSD" ; case kSSDp: return "kSSDp";
+ case kSDDp: return "kSDDp"; default : return "Undefined";};}
+ //
Int_t GetStartDet(Int_t dtype );
Int_t GetLastDet(Int_t dtype);
// Returns the starting module index number for SPD detector,
Int_t GetLastSSD() {return GetModuleIndex(6,fNlad[5],fNdet[5]);}
// Returns the last module index number.
Int_t GetIndexMax() const {return fNmodules;}
-//
+ //
// This function returns the rotation angles for a give module
// in the Double point array ang[3]. The angles are in radians
void GetAngles(Int_t index,Double_t *ang) {
- GetGeomMatrix(index)->GetAngles(ang);}
+ GetGeomMatrix(index)->GetAngles(ang);}
// This function returns the rotation angles for a give module
// in the three floating point variables provided. rx = frx,
// fy = fry, rz = frz. The angles are in radians
void GetAngles(Int_t index,Float_t &rx,Float_t &ry,Float_t &rz) {
- Double_t a[3];GetAngles(index,a);
- rx = a[0];ry = a[1];rz = a[2];}
+ Double_t a[3];GetAngles(index,a);rx = a[0];ry = a[1];rz = a[2];}
// This function returns the rotation angles for a give detector on
// a give ladder in a give layer in the three floating point variables
// provided. rx = frx, fy = fry, rz = frz. The angles are in radians
void GetAngles(Int_t lay,Int_t lad,Int_t det,
Float_t &rx,Float_t &ry,Float_t &rz) {
- GetAngles(GetModuleIndex(lay,lad,det),rx,ry,rz);}
-//
+ GetAngles(GetModuleIndex(lay,lad,det),rx,ry,rz);}
+ //
// This function returns the 6 GEANT rotation angles for a give
// module in the double point array ang[3]. The angles are in degrees
void GetGeantAngles(Int_t index,Double_t *ang){
GetGeomMatrix(index)->SixAnglesFromMatrix(ang);}
-//
+ //
// This function returns the Cartesian translation for a give
// module in the Double array t[3]. The units are
// those of the Monte Carlo, generally cm.
void GetTrans(Int_t index,Double_t *t) {
- GetGeomMatrix(index)->GetTranslation(t);}
+ GetGeomMatrix(index)->GetTranslation(t);}
// This function returns the Cartesian translation for a give
// module index in the three floating point variables provided.
// x = fx0, y = fy0, z = fz0. The units are those of the Mont
// Carlo, generally cm.
void GetTrans(Int_t index,Float_t &x,Float_t &y,Float_t &z) {
- Double_t t[3];GetTrans(index,t);
- x = t[0];y = t[1];z = t[2];}
+ Double_t t[3];GetTrans(index,t);x = t[0];y = t[1];z = t[2];}
// This function returns the Cartesian translation for a give
// detector on a give ladder in a give layer in the three floating
// point variables provided. x = fx0, y = fy0, z = fz0. The units are
// those of the Monte Carlo, generally cm.
void GetTrans(Int_t lay,Int_t lad,Int_t det,
Float_t &x,Float_t &y,Float_t &z) {
- GetTrans(GetModuleIndex(lay,lad,det),x,y,z);}
-//
+ GetTrans(GetModuleIndex(lay,lad,det),x,y,z);}
+ //
// This function returns the Cartesian translation for a give
// module in the Double array t[3]. The units are
// those of the Monte Carlo, generally cm.
void GetTransCyln(Int_t index,Double_t *t) {
- GetGeomMatrix(index)->GetTranslationCylinderical(t);}
+ GetGeomMatrix(index)->GetTranslationCylinderical(t);}
// This function returns the Cartesian translation for a give
// module index in the three floating point variables provided.
// x = fx0, y = fy0, z = fz0. The units are those of the Mont
// Carlo, generally cm.
void GetTransCyln(Int_t index,Float_t &x,Float_t &y,Float_t &z) {
- Double_t t[3];GetTransCyln(index,t);
- x = t[0];y = t[1];z = t[2];}
+ Double_t t[3];GetTransCyln(index,t);x = t[0];y = t[1];z = t[2];}
// This function returns the Cartesian translation for a give
// detector on a give ladder in a give layer in the three floating
// point variables provided. x = fx0, y = fy0, z = fz0. The units are
// those of the Monte Carlo, generally cm.
void GetTransCyln(Int_t lay,Int_t lad,Int_t det,
- Float_t &x,Float_t &y,Float_t &z) {
- GetTransCyln(GetModuleIndex(lay,lad,det),x,y,z);}
-//
+ Float_t &x,Float_t &y,Float_t &z) {
+ GetTransCyln(GetModuleIndex(lay,lad,det),x,y,z);}
+ //
// This function returns the Cartesian translation [cm] and the
// 6 GEANT rotation angles [degrees]for a given layer ladder and
// detector number, in the TVector x (at least 9 elements large).
- // This function is required to be inlined for speed.
+ // This function is required to be in-lined for speed.
void GetCenterThetaPhi(Int_t lay,Int_t lad,Int_t det,TVector &x){
- Double_t t[3],a[6];Int_t i=GetModuleIndex(lay,lad,det);GetTrans(i,t);
- GetGeantAngles(i,a);x(0)=t[0];x(1)=t[1];x(2)=t[2];x(3)=a[0];x(4)=a[1];
- x(5)=a[2];x(6)=a[3];x(7)=a[4];x(8)=a[5];}
-//
+ Double_t t[3],a[6];Int_t i=GetModuleIndex(lay,lad,det);GetTrans(i,t);
+ GetGeantAngles(i,a);x(0)=t[0];x(1)=t[1];x(2)=t[2];x(3)=a[0];x(4)=a[1];
+ x(5)=a[2];x(6)=a[3];x(7)=a[4];x(8)=a[5];}
+ //
// This function returns the rotation matrix in Double
// precision for a given module.
void GetRotMatrix(Int_t index,Double_t mat[3][3]){
- GetGeomMatrix(index)->GetMatrix(mat);}
+ GetGeomMatrix(index)->GetMatrix(mat);}
// This function returns the rotation matrix in a Double
// precision pointer for a given module. mat[i][j] => mat[3*i+j].
void GetRotMatrix(Int_t index,Double_t *mat){
- Double_t rot[3][3];GetRotMatrix(index,rot);
- for(Int_t i=0;i<3;i++)for(Int_t j=0;j<3;j++) mat[3*i+j] = rot[i][j];}
+ Double_t rot[3][3];GetRotMatrix(index,rot);
+ for(Int_t i=0;i<3;i++)for(Int_t j=0;j<3;j++) mat[3*i+j] = rot[i][j];}
// This function returns the rotation matrix in a floating
// precision pointer for a given layer ladder and detector module.
// mat[i][j] => mat[3*i+j].
- void GetRotMatrix(Int_t lay,Int_t lad,Int_t det,
- Float_t *mat){GetRotMatrix(GetModuleIndex(lay,lad,det),mat);}
+ void GetRotMatrix(Int_t lay,Int_t lad,Int_t det,Float_t *mat){
+ GetRotMatrix(GetModuleIndex(lay,lad,det),mat);}
// This function returns the rotation matrix in a Double
// precision pointer for a given layer ladder and detector module.
// mat[i][j] => mat[3*i+j].
- void GetRotMatrix(Int_t lay,Int_t lad,Int_t det,
- Double_t *mat){GetRotMatrix(GetModuleIndex(lay,lad,det),mat);}
+ void GetRotMatrix(Int_t lay,Int_t lad,Int_t det,Double_t *mat){
+ GetRotMatrix(GetModuleIndex(lay,lad,det),mat);}
// This function returns the rotation matrix in a floating
// precision pointer for a given module. mat[i][j] => mat[3*i+j].
void GetRotMatrix(Int_t index,Float_t *mat){
Double_t rot[3][3];
- GetGeomMatrix(index)->GetMatrix(rot);
+ GetGeomMatrix(index)->GetMatrix(rot);
for(Int_t i=0;i<3;i++)for(Int_t j=0;j<3;j++) mat[3*i+j] = rot[i][j];}
// This function sets the rotation matrix in a Double
// precision pointer for a given module. mat[i][j] => mat[3*i+j].
void SetRotMatrix(Int_t index,Double_t *mat){Double_t rot[3][3];
for(Int_t i=0;i<3;i++)for(Int_t j=0;j<3;j++) rot[i][j]=mat[3*i+j];
GetGeomMatrix(index)->SetMatrix(rot);}
-
-//
+ //
// Will define fShape if it isn't already defined.
- void DefineShapes(Int_t size=4)
- {if(fShape==0) fShape = new TObjArray(size);else fShape->Expand(size);}
+ void DefineShapes(Int_t size=5){fShape.Expand(size);}
+ // this function returns a pointer to the array of detector
+ // descriptions, Segmentation.
+ virtual TObjArray *GetShapeArray(){return &fShape;};
// this function returns a pointer to the class describing a particular
// detector type based on AliITSDetector value. This will return a pointer
- // to one of the classes AliITSgeomSPD, AliITSgeomSDD, or AliITSgeomSSD,
- // for example.
- virtual TObject *GetShape(AliITSDetector idet)
- {return fShape->At((Int_t)idet);};
+ // to one of the classes AliITSgeomSPD, AliITSgeomSDD, or
+ // AliITSgeomSSD, for example.
+ virtual TObject *GetShape(AliITSDetector idet){
+ return fShape.At((Int_t)idet);};
// This function returns a pointer to the class describing the
// detector for a particular module index. This will return a pointer
- // to one of the classes AliITSgeomSPD, AliITSgeomSDD, or AliITSgeomSSD,
- // for example.
+ // to one of the classes AliITSgeomSPD, AliITSgeomSDD,
+ // or AliITSgeomSSD, for example.
virtual TObject *GetShape(Int_t index){
- return fShape->At(GetGeomMatrix(index)->
- GetDetectorIndex());}
+ return fShape.At(GetGeomMatrix(index)->GetDetectorIndex());}
// This function returns a pointer to the class describing the
// detector for a particular layer ladder and detector numbers. This
// will return a pointer to one of the classes AliITSgeomSPD,
// AliITSgeomSDD, or AliITSgeomSSD, for example.
virtual TObject *GetShape(Int_t lay,Int_t lad,Int_t det)
- {return GetShape(GetModuleIndex(lay,lad,det));}
-//
-// Setters
+ {return GetShape(GetModuleIndex(lay,lad,det));}
+ //
+ // Setters
// Sets the rotation angles and matrix for a give module index
// via the double precision array a[3] [radians].
void SetByAngles(Int_t index,const Double_t a[]){
- GetGeomMatrix(index)->SetAngles(a);}
+ GetGeomMatrix(index)->SetAngles(a);}
// Sets the rotation angles and matrix for a give module index
// via the 3 floating precision variables rx, ry, and rz [radians].
- void SetByAngles(Int_t index,
- Float_t rx, Float_t ry, Float_t rz) {
- Double_t a[3];a[0] = rx;a[1] = ry;a[2] = rz;
- GetGeomMatrix(index)->SetAngles(a);}
+ void SetByAngles(Int_t index,Float_t rx, Float_t ry, Float_t rz) {
+ Double_t a[3];a[0] = rx;a[1] = ry;a[2] = rz;
+ GetGeomMatrix(index)->SetAngles(a);}
// Sets the rotation angles and matrix for a give layer, ladder,
// and detector numbers via the 3 floating precision variables rx,
// ry, and rz [radians].
void SetByAngles(Int_t lay,Int_t lad,Int_t det,
Float_t rx, Float_t ry, Float_t rz) {
- SetByAngles(GetModuleIndex(lay,lad,det),rx,ry,rz);}
-//
+ SetByAngles(GetModuleIndex(lay,lad,det),rx,ry,rz);}
+ //
// Sets the rotation angles and matrix for a give module index
// via the Double precision array a[6] [degree]. The angles are those
// defined by GEANT 3.12.
void SetByGeantAngles(Int_t index,const Double_t *ang){
- GetGeomMatrix(index)->MatrixFromSixAngles(ang);}
+ GetGeomMatrix(index)->MatrixFromSixAngles(ang);}
// Sets the rotation angles and matrix for a give layer, ladder
// and detector, in the array id[3] via the Double precision array
// a[6] [degree]. The angles are those defined by GEANT 3.12.
void SetByGeantAngles(const Int_t *id,const Double_t *ang){
- SetByGeantAngles(GetModuleIndex(id),ang);}
+ SetByGeantAngles(GetModuleIndex(id),ang);}
// Sets the rotation angles and matrix for a give layer, ladder
// and detector, via the Double precision array a[6] [degree]. The
// angles are those defined by GEANT 3.12.
void SetByGeantAngles(Int_t lay,Int_t lad,Int_t det,
- const Double_t *ang){
- SetByGeantAngles(GetModuleIndex(lay,lad,det),ang);}
-//
+ const Double_t *ang){
+ SetByGeantAngles(GetModuleIndex(lay,lad,det),ang);}
+ //
// This function sets a new translation vector, given by the
// array x[3], for the Cartesian coordinate transformation
// for a give module index.
void SetTrans(Int_t index,Double_t x[]){
- GetGeomMatrix(index)->SetTranslation(x);}
+ GetGeomMatrix(index)->SetTranslation(x);}
// This function sets a new translation vector, given by the three
// variables x, y, and z, for the Cartesian coordinate transformation
// for the detector defined by layer, ladder and detector.
Float_t x,Float_t y,Float_t z){Double_t t[3];
t[0] = x;t[1] = y;t[2] = z;
SetTrans(GetModuleIndex(lay,lad,det),t);}
-//
+ //
// This function adds one more shape element to the TObjArray
// fShape. It is primarily used in the constructor functions of the
// AliITSgeom class. The pointer *shape can be the pointer to any
// class that is derived from TObject (this is true for nearly every
// ROOT class). This does not appear to be working properly at this time.
- void AddShape(TObject *shp){fShape->AddLast(shp);}
+ void AddShape(TObject *shp){fShape.AddLast(shp);}
// This function deletes an existing shape element, of type TObject,
// and replaces it with the one specified. This is primarily used to
- // changes the parameters to the segmentation class for a particular
+ // changes the parameters to the geom class for a particular
// type of detector.
void ReSetShape(Int_t dtype,TObject *shp){
- fShape->RemoveAt(dtype);fShape->AddAt(shp,dtype);}
-//
-// transformations
+ delete (fShape.At(dtype));fShape.AddAt(shp,dtype);}
+ //
+ // transformations
// Transforms from the ALICE Global coordinate system
// to the detector local coordinate system for the detector
// defined by the layer, ladder, and detector numbers. The
// global and local coordinate are given in two floating point
// arrays g[3], and l[3].
void GtoL(Int_t lay,Int_t lad,Int_t det,
- const Float_t *g,Float_t *l){
- GtoL(GetModuleIndex(lay,lad,det),g,l);}
+ const Float_t *g,Float_t *l){
+ GtoL(GetModuleIndex(lay,lad,det),g,l);}
// Transforms from the ALICE Global coordinate system
// to the detector local coordinate system for the detector
// defined by the id[0], id[1], and id[2] numbers. The
// global and local coordinate are given in two floating point
// arrays g[3], and l[3].
void GtoL(const Int_t *id,const Float_t *g,Float_t *l){
- GtoL(GetModuleIndex(id),g,l);}
+ GtoL(GetModuleIndex(id),g,l);}
// Transforms from the ALICE Global coordinate system
// to the detector local coordinate system for the detector
// module index number. The global and local coordinate are
// given in two floating point arrays g[3], and l[3].
void GtoL(Int_t index,const Float_t *g,Float_t *l){
- Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
- GetGeomMatrix(index)->GtoLPosition(dg,dl);
- for(i=0;i<3;i++) l[i] =dl[i];}
+ Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
+ GetGeomMatrix(index)->GtoLPosition(dg,dl);
+ for(i=0;i<3;i++) l[i] =dl[i];}
// Transforms from the ALICE Global coordinate system
// to the detector local coordinate system for the detector
// defined by the layer, ladder, and detector numbers. The
// global and local coordinate are given in two Double point
// arrays g[3], and l[3].
void GtoL(Int_t lay,Int_t lad,Int_t det,
- const Double_t *g,Double_t *l){
- GtoL(GetModuleIndex(lay,lad,det),g,l);}
+ const Double_t *g,Double_t *l){
+ GtoL(GetModuleIndex(lay,lad,det),g,l);}
// Transforms from the ALICE Global coordinate system
// to the detector local coordinate system for the detector
// defined by the id[0], id[1], and id[2] numbers. The
// global and local coordinate are given in two Double point
// arrays g[3], and l[3].
void GtoL(const Int_t *id,const Double_t *g,Double_t *l){
- GtoL(GetModuleIndex(id),g,l);}
+ GtoL(GetModuleIndex(id),g,l);}
// Transforms from the ALICE Global coordinate system
// to the detector local coordinate system for the detector
// module index number. The global and local coordinate are
// given in two Double point arrays g[3], and l[3].
void GtoL(Int_t index,const Double_t *g,Double_t *l){
- Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
- GetGeomMatrix(index)->GtoLPosition(dg,dl);
- for(i=0;i<3;i++) l[i] =dl[i];}
-//
+ Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
+ GetGeomMatrix(index)->GtoLPosition(dg,dl);
+ for(i=0;i<3;i++) l[i] =dl[i];}
+ //
// Transforms from the ALICE Global coordinate system
// to the detector local coordinate system (used for ITS tracking)
// for the detector module index number. The global and local
// coordinate are given in two Double point arrays g[3], and l[3].
void GtoLtracking(Int_t index,const Double_t *g,Double_t *l){
- if(IsGeantToTracking()) GtoL(index,g,l);
- else GetGeomMatrix(index)->GtoLPositionTracking(g,l);}
+ if(IsGeantToTracking()) GtoL(index,g,l);
+ else GetGeomMatrix(index)->GtoLPositionTracking(g,l);}
// Transforms from the ALICE Global coordinate system
// to the detector local coordinate system (used for ITS tracking)
// for the detector id[3]. The global and local
// coordinate are given in two Double point arrays g[3], and l[3].
void GtoLtracking(const Int_t *id,const Double_t *g,Double_t *l){
- GtoLtracking(GetModuleIndex(id),g,l);}
+ GtoLtracking(GetModuleIndex(id),g,l);}
// Transforms from the ALICE Global coordinate system
// to the detector local coordinate system (used for ITS tracking)
// for the detector layer ladder and detector numbers. The global
// and local coordinate are given in two Double point arrays g[3],
// and l[3].
void GtoLtracking(Int_t lay,Int_t lad,Int_t det,
- const Double_t *g,Double_t *l){
- GtoLtracking(GetModuleIndex(lay,lad,det),g,l);}
-//
+ const Double_t *g,Double_t *l){
+ GtoLtracking(GetModuleIndex(lay,lad,det),g,l);}
+ //
// Transforms of momentum types of quantities from the ALICE
// Global coordinate system to the detector local coordinate system
// for the detector layer ladder and detector numbers. The global
// and local coordinate are given in two float point arrays g[3],
// and l[3].
void GtoLMomentum(Int_t lay,Int_t lad,Int_t det,
- const Float_t *g,Float_t *l){
- GtoLMomentum(GetModuleIndex(lay,lad,det),g,l);}
+ const Float_t *g,Float_t *l){
+ GtoLMomentum(GetModuleIndex(lay,lad,det),g,l);}
// Transforms of momentum types of quantities from the ALICE
// Global coordinate system to the detector local coordinate system
// for the detector module index number. The global and local
// coordinate are given in two float point arrays g[3], and l[3].
void GtoLMomentum(Int_t index,const Float_t *g,Float_t *l){
- Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
- GetGeomMatrix(index)->GtoLMomentum(dg,dl);
- for(i=0;i<3;i++) l[i] =dl[i];}
+ Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
+ GetGeomMatrix(index)->GtoLMomentum(dg,dl);
+ for(i=0;i<3;i++) l[i] =dl[i];}
// Transforms of momentum types of quantities from the ALICE
// Global coordinate system to the detector local coordinate system
// for the detector layer ladder and detector numbers. The global
// and local coordinate are given in two Double point arrays g[3],
// and l[3].
void GtoLMomentum(Int_t lay,Int_t lad,Int_t det,
- const Double_t *g,Double_t *l){
- GtoLMomentum(GetModuleIndex(lay,lad,det),g,l);}
+ const Double_t *g,Double_t *l){
+ GtoLMomentum(GetModuleIndex(lay,lad,det),g,l);}
// Transforms of momentum types of quantities from the ALICE
// Global coordinate system to the detector local coordinate system
// for the detector module index number. The global and local
// coordinate are given in two Double point arrays g[3], and l[3].
void GtoLMomentum(Int_t index,const Double_t *g,Double_t *l){
- Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
- GetGeomMatrix(index)->GtoLMomentum(dg,dl);
- for(i=0;i<3;i++) l[i] =dl[i];}
-//
+ Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
+ GetGeomMatrix(index)->GtoLMomentum(dg,dl);
+ for(i=0;i<3;i++) l[i] =dl[i];}
+ //
// Transforms of momentum types of quantities from the ALICE
// Global coordinate system to the detector local coordinate system
// (used for ITS tracking) for the detector module index number.
// The global and local coordinate are given in two Double point
// arrays g[3], and l[3].
void GtoLMomentumTracking(Int_t index,const Double_t *g,Double_t *l){
- if(IsGeantToTracking()) GtoLMomentum(index,g,l);
- else GetGeomMatrix(index)->GtoLMomentumTracking(g,l);}
+ if(IsGeantToTracking()) GtoLMomentum(index,g,l);
+ else GetGeomMatrix(index)->GtoLMomentumTracking(g,l);}
// Transforms of momentum types of quantities from the ALICE
// Global coordinate system to the detector local coordinate system
// (used for ITS tracking) for the detector id[3].
// The global and local coordinate are given in two Double point
// arrays g[3], and l[3].
void GtoLMomentumTracking(const Int_t *id,const Double_t *g,Double_t *l){
- GtoLMomentumTracking(GetModuleIndex(id),g,l);}
+ GtoLMomentumTracking(GetModuleIndex(id),g,l);}
// Transforms of momentum types of quantities from the ALICE
// Global coordinate system to the detector local coordinate system
// (used for ITS tracking) for the detector layer ladder and detector
// numbers. The global and local coordinate are given in two Double point
// arrays g[3], and l[3].
void GtoLMomentumTracking(Int_t lay,Int_t lad,Int_t det,
- const Double_t *g,Double_t *l){
- GtoLMomentumTracking(GetModuleIndex(lay,lad,det),g,l);}
-//
+ const Double_t *g,Double_t *l){
+ GtoLMomentumTracking(GetModuleIndex(lay,lad,det),g,l);}
+ //
// Transforms from the detector local coordinate system
// to the ALICE Global coordinate system for the detector
// defined by the layer, ladder, and detector numbers. The
// global and local coordinate are given in two floating point
// arrays g[3], and l[3].
void LtoG(Int_t lay,Int_t lad,Int_t det,
- const Float_t *l,Float_t *g){
- LtoG(GetModuleIndex(lay,lad,det),l,g);}
+ const Float_t *l,Float_t *g){
+ LtoG(GetModuleIndex(lay,lad,det),l,g);}
// Transforms from the detector local coordinate system
// to the ALICE Global coordinate system for the detector
// defined by the id[0], id[1], and id[2] numbers. The
// global and local coordinate are given in two floating point
// arrays g[3], and l[3].
void LtoG(const Int_t *id,const Float_t *l,Float_t *g){
- LtoG(GetModuleIndex(id),l,g);}
+ LtoG(GetModuleIndex(id),l,g);}
// Transforms from the detector local coordinate system
// to the ALICE Global coordinate system for the detector
// module index number. The global and local coordinate are
// given in two floating point arrays g[3], and l[3].
void LtoG(Int_t index,const Float_t *l,Float_t *g){
- Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
- GetGeomMatrix(index)->LtoGPosition(dl,dg);
- for(i=0;i<3;i++) g[i] =dg[i];}
+ Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
+ GetGeomMatrix(index)->LtoGPosition(dl,dg);
+ for(i=0;i<3;i++) g[i] =dg[i];}
// Transforms from the detector local coordinate system
// to the ALICE Global coordinate system for the detector
// defined by the layer, ladder, and detector numbers. The
// global and local coordinate are given in two Double point
// arrays g[3], and l[3].
void LtoG(Int_t lay,Int_t lad,Int_t det,
- const Double_t *l,Double_t *g){
- LtoG(GetModuleIndex(lay,lad,det),l,g);}
+ const Double_t *l,Double_t *g){
+ LtoG(GetModuleIndex(lay,lad,det),l,g);}
// Transforms from the detector local coordinate system
// to the ALICE Global coordinate system for the detector
// defined by the id[0], id[1], and id[2] numbers. The
// global and local coordinate are given in two Double point
// arrays g[3], and l[3].
void LtoG(const Int_t *id,const Double_t *l,Double_t *g){
- LtoG(GetModuleIndex(id),l,g);}
+ LtoG(GetModuleIndex(id),l,g);}
// Transforms from the detector local coordinate system
// to the ALICE Global coordinate system for the detector
// module index number. The global and local coordinate are
// given in two Double point arrays g[3], and l[3].
void LtoG(Int_t index,const Double_t *l,Double_t *g){
- Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
- GetGeomMatrix(index)->LtoGPosition(dl,dg);
- for(i=0;i<3;i++) g[i] =dg[i];}
-//
+ Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
+ GetGeomMatrix(index)->LtoGPosition(dl,dg);
+ for(i=0;i<3;i++) g[i] =dg[i];}
+ //
// Transforms from the detector local coordinate system (used
// for ITS tracking) to the ALICE Global coordinate system
// for the detector module index number. The global and local
// coordinate are given in two Double point arrays g[3], and l[3].
void LtoGtracking(Int_t index,const Double_t *l,Double_t *g){
- if(IsGeantToTracking()) LtoG(index,l,g);
- else GetGeomMatrix(index)->LtoGPositionTracking(l,g);}
+ if(IsGeantToTracking()) LtoG(index,l,g);
+ else GetGeomMatrix(index)->LtoGPositionTracking(l,g);}
// Transforms from the detector local coordinate system (used
// for ITS tracking) to the ALICE Global coordinate system
// for the detector id[3]. The global and local
// coordinate are given in two Double point arrays g[3], and l[3].
void LtoGtracking(const Int_t *id,const Double_t *l,Double_t *g){
- LtoGtracking(GetModuleIndex(id),l,g);}
+ LtoGtracking(GetModuleIndex(id),l,g);}
// Transforms from the detector local coordinate system (used
// for ITS tracking) to the detector local coordinate system
// for the detector layer ladder and detector numbers. The global
// and local coordinate are given in two Double point arrays g[3],
// and l[3].
void LtoGtracking(Int_t lay,Int_t lad,Int_t det,
- const Double_t *l,Double_t *g){
- LtoGtracking(GetModuleIndex(lay,lad,det),l,g);}
-//
+ const Double_t *l,Double_t *g){
+ LtoGtracking(GetModuleIndex(lay,lad,det),l,g);}
+ //
// Transforms of momentum types of quantities from the detector
// local coordinate system to the ALICE Global coordinate system
// for the detector layer ladder and detector numbers. The global
// and local coordinate are given in two float point arrays g[3],
// and l[3].
void LtoGMomentum(Int_t lay,Int_t lad,Int_t det,
- const Float_t *l,Float_t *g){
- LtoGMomentum(GetModuleIndex(lay,lad,det),l,g);}
+ const Float_t *l,Float_t *g){
+ LtoGMomentum(GetModuleIndex(lay,lad,det),l,g);}
// Transforms of momentum types of quantities from the detector
// local coordinate system to the ALICE Global coordinate system
// for the detector module index number. The global and local
// coordinate are given in two float point arrays g[3], and l[3].
void LtoGMomentum(Int_t index,const Float_t *l,Float_t *g){
- Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
- GetGeomMatrix(index)->LtoGMomentum(dl,dg);
- for(i=0;i<3;i++) g[i] =dg[i];}
+ Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
+ GetGeomMatrix(index)->LtoGMomentum(dl,dg);
+ for(i=0;i<3;i++) g[i] =dg[i];}
// Transforms of momentum types of quantities from the detector
// local coordinate system to the ALICE Global coordinate system
// for the detector layer ladder and detector numbers. The global
// and local coordinate are given in two Double point arrays g[3],
// and l[3].
void LtoGMomentum(Int_t lay,Int_t lad,Int_t det,
- const Double_t *l,Double_t *g){
- LtoGMomentum(GetModuleIndex(lay,lad,det),l,g);}
+ const Double_t *l,Double_t *g){
+ LtoGMomentum(GetModuleIndex(lay,lad,det),l,g);}
// Transforms of momentum types of quantities from the detector
// local coordinate system to the ALICE Global coordinate system
// for the detector module index number. The global and local
// coordinate are given in two Double point arrays g[3], and l[3].
void LtoGMomentum(Int_t index,const Double_t *l,Double_t *g){
- GetGeomMatrix(index)->LtoGMomentum(l,g);}
-//
+ GetGeomMatrix(index)->LtoGMomentum(l,g);}
+ //
// Transforms of momentum types of quantities from the detector
// local coordinate system (used for ITS tracking) to the detector
// system ALICE Global for the detector module index number.
// The global and local coordinate are given in two Double point
// arrays g[3], and l[3].
void LtoGMomentumTracking(Int_t index,const Double_t *l,Double_t *g){
- if(IsGeantToTracking()) LtoGMomentum(index,l,g);
- else GetGeomMatrix(index)->LtoGMomentumTracking(l,g);}
+ if(IsGeantToTracking()) LtoGMomentum(index,l,g);
+ else GetGeomMatrix(index)->LtoGMomentumTracking(l,g);}
// Transforms of momentum types of quantities from the detector
// local coordinate system (used for ITS tracking) to the ALICE
// Global coordinate system for the detector id[3].
// The global and local coordinate are given in two Double point
// arrays g[3], and l[3].
void LtoGMomentumTracking(const Int_t *id,const Double_t *l,Double_t *g){
- LtoGMomentumTracking(GetModuleIndex(id),l,g);}
+ LtoGMomentumTracking(GetModuleIndex(id),l,g);}
// Transforms of momentum types of quantities from the detector
// local coordinate system (used for ITS tracking) to the ALICE
// Global coordinate system for the detector layer ladder and detector
// numbers. The global and local coordinate are given in two Double point
// arrays g[3], and l[3].
void LtoGMomentumTracking(Int_t lay,Int_t lad,Int_t det,
- const Double_t *l,Double_t *g){
+ const Double_t *l,Double_t *g){
LtoGMomentumTracking(GetModuleIndex(lay,lad,det),l,g);}
-//
+ //
// Transforms from one detector local coordinate system
// to another detector local coordinate system for the detector
// module index1 number to the detector module index2 number. The
// local coordinates are given in two Double point arrays l1[3],
// and l2[3].
void LtoL(Int_t index1,Int_t index2,Double_t *l1,Double_t *l2){
- Double_t g[3]; LtoG(index1,l1,g);GtoL(index2,g,l2);}
+ Double_t g[3]; LtoG(index1,l1,g);GtoL(index2,g,l2);}
// Transforms from one detector local coordinate system
// to another detector local coordinate system for the detector
// id1[3] to the detector id2[3]. The local coordinates are given
// in two Double point arrays l1[3], and l2[3].
void LtoL(const Int_t *id1,const Int_t *id2,Double_t *l1,Double_t *l2){
- LtoL(GetModuleIndex(id1[0],id1[1],id1[2]),
+ LtoL(GetModuleIndex(id1[0],id1[1],id1[2]),
GetModuleIndex(id2[0],id2[1],id2[2]),l1,l2);}
-//
+ //
// Transforms from one detector local coordinate system (used for
// ITS tracking) to another detector local coordinate system (used
// for ITS tracking) for the detector module index1 number to the
// detector module index2 number. The local coordinates are given
// in two Double point arrays l1[3], and l2[3].
void LtoLtracking(Int_t index1,Int_t index2,
- Double_t *l1,Double_t *l2){
- Double_t g[3]; LtoGtracking(index1,l1,g);GtoLtracking(index2,g,l2);}
+ Double_t *l1,Double_t *l2){
+ Double_t g[3]; LtoGtracking(index1,l1,g);GtoLtracking(index2,g,l2);}
// Transforms from one detector local coordinate system (used for
// ITS tracking) to another detector local coordinate system (used
// for ITS tracking) for the detector id1[3] to the detector id2[3].
// The local coordinates are given in two Double point arrays l1[3],
// and l2[3].
void LtoLtracking(const Int_t *id1,const Int_t *id2,
- Double_t *l1,Double_t *l2){
- LtoLtracking(GetModuleIndex(id1[0],id1[1],id1[2]),
- GetModuleIndex(id2[0],id2[1],id2[2]),l1,l2);}
-//
+ Double_t *l1,Double_t *l2){
+ LtoLtracking(GetModuleIndex(id1[0],id1[1],id1[2]),
+ GetModuleIndex(id2[0],id2[1],id2[2]),l1,l2);}
+ //
// Transforms of momentum types of quantities from one detector
// local coordinate system to another detector local coordinate
// system for the detector module index1 number to the detector
// module index2 number. The local coordinates are given in two
// Double point arrays l1[3], and l2[3].
void LtoLMomentum(Int_t index1,Int_t index2,
- const Double_t *l1,Double_t *l2){
- Double_t g[3]; LtoGMomentum(index1,l1,g);GtoLMomentum(index2,g,l2);}
+ const Double_t *l1,Double_t *l2){
+ Double_t g[3]; LtoGMomentum(index1,l1,g);GtoLMomentum(index2,g,l2);}
// Transforms of momentum types of quantities from one detector
// local coordinate system to another detector local coordinate
// system for the detector id1[3] to the detector id2[3]. The local
// coordinates are given in two Double point arrays l1[3], and l2[3].
void LtoLMomentum(const Int_t *id1,const Int_t *id2,
- const Double_t *l1,Double_t *l2){
- LtoLMomentum(GetModuleIndex(id1[0],id1[1],id1[2]),
- GetModuleIndex(id2[0],id2[1],id2[2]),l1,l2);}
-//
+ const Double_t *l1,Double_t *l2){
+ LtoLMomentum(GetModuleIndex(id1[0],id1[1],id1[2]),
+ GetModuleIndex(id2[0],id2[1],id2[2]),l1,l2);}
+ //
// Transforms of momentum types of quantities from one detector
// local coordinate system (used by ITS tracking) to another detector
// local coordinate system (used by ITS tracking) for the detector
// local coordinates are given in two Double point arrays l1[3],
// and l2[3].
void LtoLMomentumTracking(Int_t index1,Int_t index2,
- Double_t *l1,Double_t *l2){
- Double_t g[3]; LtoGMomentumTracking(index1,l1,g);
- GtoLMomentumTracking(index2,g,l2);}
+ Double_t *l1,Double_t *l2){
+ Double_t g[3]; LtoGMomentumTracking(index1,l1,g);
+ GtoLMomentumTracking(index2,g,l2);}
// Transforms of momentum types of quantities from one detector
// local coordinate system (used by ITS tracking) to another detector
// local coordinate system (used by ITS tracking) for the detector
// id1[3] to the detector id2[3]. The local coordinates are given in
// two Double point arrays l1[3], and l2[3].
void LtoLMomentumTracking(const Int_t *id1,const Int_t *id2,
- Double_t *l1,Double_t *l2){
- LtoLMomentumTracking(GetModuleIndex(id1[0],id1[1],id1[2]),
+ Double_t *l1,Double_t *l2){
+ LtoLMomentumTracking(GetModuleIndex(id1[0],id1[1],id1[2]),
GetModuleIndex(id2[0],id2[1],id2[2]),l1,l2);}
-//
+ //
// Transforms a matrix, like an Uncertainty or Error matrix from
// the ALICE Global coordinate system to a detector local coordinate
// system. The specific detector is determined by the module index
// number.
void GtoLErrorMatrix(Int_t index,const Double_t **g,Double_t **l){
- GetGeomMatrix(index)->GtoLPositionError((Double_t (*)[3])g,(Double_t (*)[3])l);}
-//
+ GetGeomMatrix(index)->GtoLPositionError((Double_t (*)[3])g,(Double_t (*)[3])l);}
+ //
// Transforms a matrix, like an Uncertainty or Error matrix from
// the ALICE Global coordinate system to a detector local coordinate
// system (used by ITS tracking). The specific detector is determined
// by the module index number.
void GtoLErrorMatrixTracking(Int_t index,const Double_t **g,
- Double_t **l){
- if(IsGeantToTracking()) GetGeomMatrix(index)->GtoLPositionError((
- Double_t (*)[3])g,(Double_t (*)[3])l);
- else GetGeomMatrix(index)->GtoLPositionErrorTracking(
- (Double_t (*)[3])g,(Double_t (*)[3])l);}
-//
+ Double_t **l){
+ if(IsGeantToTracking()) GetGeomMatrix(index)->GtoLPositionError((
+ Double_t (*)[3])g,(Double_t (*)[3])l);
+ else GetGeomMatrix(index)->GtoLPositionErrorTracking(
+ (Double_t (*)[3])g,(Double_t (*)[3])l);}
+ //
// Transforms a matrix, like an Uncertainty or Error matrix from
// the detector local coordinate system to a ALICE Global coordinate
// system. The specific detector is determined by the module index
// number.
void LtoGErrorMatrix(Int_t index,const Double_t **l,Double_t **g){
- GetGeomMatrix(index)->LtoGPositionError((Double_t (*)[3])l,(Double_t (*)[3])g);}
-//
+ GetGeomMatrix(index)->LtoGPositionError((Double_t (*)[3])l,(Double_t (*)[3])g);}
+ //
// Transforms a matrix, like an Uncertainty or Error matrix from
// the detector local coordinate system (used by ITS tracking) to a
// ALICE Global coordinate system. The specific detector is determined
// by the module index number.
void LtoGErrorMatrixTracking(Int_t index,const Double_t **l,
- Double_t **g){
- if(IsGeantToTracking()) GetGeomMatrix(index)->LtoGPositionError((
- Double_t (*)[3])g,(Double_t (*)[3])l);
- else GetGeomMatrix(index)->LtoGPositionErrorTracking((Double_t (*)[3])l,
- (Double_t (*)[3])g);}
-//
+ Double_t **g){
+ if(IsGeantToTracking()) GetGeomMatrix(index)->LtoGPositionError((
+ Double_t (*)[3])g,(Double_t (*)[3])l);
+ else GetGeomMatrix(index)->LtoGPositionErrorTracking((Double_t (*)[3])l,
+ (Double_t (*)[3])g);}
+ //
// Transforms a matrix, like an Uncertainty or Error matrix from
// one detector local coordinate system to another detector local
// coordinate system. The specific detector is determined by the
// two module index number index1 and index2.
void LtoLErrorMatrix(Int_t index1,Int_t index2,
- const Double_t **l1,Double_t **l2){
- Double_t g[3][3];
- LtoGErrorMatrix(index1,l1,(Double_t **)g);
- GtoLErrorMatrix(index2,(const Double_t **)g,l2);}
-//
+ const Double_t **l1,Double_t **l2){
+ Double_t g[3][3];
+ LtoGErrorMatrix(index1,l1,(Double_t **)g);
+ GtoLErrorMatrix(index2,(const Double_t **)g,l2);}
+ //
// Transforms a matrix, like an Uncertainty or Error matrix from
// one detector local coordinate system (used by ITS tracking) to
// another detector local coordinate system (used by ITS tracking).
// The specific detector is determined by the two module index number
// index1 and index2.
void LtoLErrorMatrixTraking(Int_t index1,Int_t index2,
- const Double_t **l1,Double_t **l2){Double_t g[3][3];
- LtoGErrorMatrixTracking(index1,l1,(Double_t **)g);
- GtoLErrorMatrixTracking(index2,(const Double_t **)g,l2);}
-// Find Specific Modules
+ const Double_t **l1,Double_t **l2){
+ Double_t g[3][3];
+ LtoGErrorMatrixTracking(index1,l1,(Double_t **)g);
+ GtoLErrorMatrixTracking(index2,(const Double_t **)g,l2);}
+ // Find Specific Modules
// Locate the nearest module to the point g, in ALICE global Cartesian
// coordinates [cm] in a give layer. If layer = 0 then it search in
// all layers.
// Returns the distance [cm] between the point g[3] and the center of
// the detector/module specified by the the module index number.
Double_t Distance(Int_t index,const Double_t g[3]){
- return TMath::Sqrt(GetGeomMatrix(index)->Distance2(g));}
-// Geometry manipulation
+ return TMath::Sqrt(GetGeomMatrix(index)->Distance2(g));}
+ // loops over modules and computes the average cylindrical
+ // radius to a given layer and the range.
+ Double_t GetAverageRadiusOfLayer(Int_t layer,Double_t &range);
+ // Geometry manipulation
// This function performs a Cartesian translation and rotation of
// the full ITS from its default position by an amount determined by
// the three element arrays tran and rot.
// This function converts these transformations from Alice global and
// local to Tracking global and local.
void GeantToTracking(AliITSgeom &source); // This converts the geometry
-// Other routines.
+ // Other routines.
// This routine prints, to a file, the difference between this class
// and "other".
void PrintComparison(FILE *fp,AliITSgeom *other);
void TrackingV2ToDetL(Int_t md,Float_t yin,Float_t zin,Float_t &xout,Float_t &zout);
private:
- char fVersion[20];// Transformation version.
+ TString fVersion; // Transformation version.
Int_t fTrans; // Flag to keep track of which transformation
Int_t fNmodules;// The total number of modules
Int_t fNlayers; // The number of layers.
- Int_t *fNlad; //[fNlayers] Array of the number of ladders/layer(layer)
- Int_t *fNdet;//[fNlayers] Array of the number of detector/ladder(layer)
- TObjArray *fGm; // Structure of translation. and rotation.
- TObjArray *fShape; // Array of shapes and detector information.
+ TArrayI fNlad; // Array of the number of ladders/layer(layer)
+ TArrayI fNdet; // Array of the number of detector/ladder(layer)
+ TObjArray fGm; // Structure of translation. and rotation.
+ TObjArray fShape; // Array of shapes and detector information.
- ClassDef(AliITSgeom,2) // ITS geometry class
+ ClassDef(AliITSgeom,3) // ITS geometry class
};
#endif
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/* $Id$ */
-
-////////////////////////////////////////////////////////////////////////
-// This is the implementation file for AliITSgeomMatrix class. It
-// contains the routines to manipulate, setup, and queary the geometry
-// of a given ITS module. An ITS module may be one of at least three
-// ITS detector technologies, Silicon Pixel, Drift, or Strip Detectors,
-// and variations of these in size and/or layout. These routines let
-// one go between ALICE global coordiantes (cm) to a given modules
-// specific local coordinates (cm).
-////////////////////////////////////////////////////////////////////////
+/*
+$Id$
+*/
+/*
+ This is the implementation file for AliITSgeomMatrix class. It
+ contains the routines to manipulate, setup, and queary the geometry
+ of a given ITS module. An ITS module may be one of at least three
+ ITS detector technologies, Silicon Pixel, Drift, or Strip Detectors,
+ and variations of these in size and/or layout. These routines let
+ one go between ALICE global coordiantes (cm) to a given modules
+ specific local coordinates (cm).
+*/
#include <Riostream.h>
#include <TMath.h>
#include <TBuffer.h>
#include <TClass.h>
+#include <TCanvas.h>
+#include <TView.h>
+#include <TPolyLine3D.h>
+//#include <TPolyLineShape.h>
+#include <TNode.h>
+#include <TPCON.h>
+#include <TBRIK.h>
+#include <TXTRU.h>
#include "AliITSgeomMatrix.h"
ClassImp(AliITSgeomMatrix)
//----------------------------------------------------------------------
-AliITSgeomMatrix::AliITSgeomMatrix(){
-////////////////////////////////////////////////////////////////////////
-// The Default constructor for the AliITSgeomMatrix class. By Default
-// the angles of rotations are set to zero, meaning that the rotation
-// matrix is the unit matrix. The translation vector is also set to zero
-// as are the module id number. The detector type is set to -1 (an undefined
-// value). The full rotation matrix is kept so that the evaluation
-// of a coordinate transformation can be done quickly and with a minimum
-// of CPU overhead. The basic coordinate systems are the ALICE global
-// coordinate system and the detector local coordinate system. In general
-// this structure is not limited to just those two coordinate systems.
-//Begin_Html
-/*
-<img src="picts/ITS/AliISgeomMatrix_L1.gif">
-*/
-//End_Html
-////////////////////////////////////////////////////////////////////////
+AliITSgeomMatrix::AliITSgeomMatrix():
+TObject(),
+fDetectorIndex(0), // Detector type index (like fShapeIndex was)
+fid(), // layer, ladder, detector numbers.
+frot(), //! vector of rotations about x,y,z [radians].
+ftran(), // Translation vector of module x,y,z.
+fCylR(0.0), //! R Translation in Cylinderical coordinates
+fCylPhi(0.0),//! Phi Translation vector in Cylindrical coord.
+fm(), // Rotation matrix based on frot.
+fPath(){ // Path in geometry to this module
+ // The Default constructor for the AliITSgeomMatrix class. By Default
+ // the angles of rotations are set to zero, meaning that the rotation
+ // matrix is the unit matrix. The translation vector is also set to
+ // zero as are the module id number. The detector type is set to -1
+ // (an undefined value). The full rotation matrix is kept so that
+ // the evaluation of a coordinate transformation can be done
+ // quickly and with a minimum of CPU overhead. The basic coordinate
+ // systems are the ALICE global coordinate system and the detector
+ // local coordinate system. In general this structure is not limited
+ // to just those two coordinate systems.
+ //Begin_Html
+ /*
+ <img src="picts/ITS/AliITSgeomMatrix_L1.gif">
+ */
+ //End_Html
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // A default constructes AliITSgeomMatrix class.
Int_t i,j;
fDetectorIndex = -1; // a value never defined.
//----------------------------------------------------------------------
AliITSgeomMatrix::AliITSgeomMatrix(const AliITSgeomMatrix &sourse) :
TObject(sourse){
-////////////////////////////////////////////////////////////////////////
-// The standard Copy constructor. This make a full / proper copy of
-// this class.
-////////////////////////////////////////////////////////////////////////
+ // The standard Copy constructor. This make a full / proper copy of
+ // this class.
+ // Inputs:
+ // AliITSgeomMatrix &source The source of this copy
+ // Outputs:
+ // none.
+ // Return:
+ // A copy constructes AliITSgeomMatrix class.
Int_t i,j;
this->fDetectorIndex = sourse.fDetectorIndex;
this->fCylPhi = sourse.fCylPhi;
for(j=0;j<3;j++) this->fm[i][j] = sourse.fm[i][j];
}// end for i
+ this->fPath = sourse.fPath;
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::operator=(const AliITSgeomMatrix &sourse){
-////////////////////////////////////////////////////////////////////////
-// The standard = operator. This make a full / proper copy of
-// this class.
-////////////////////////////////////////////////////////////////////////
+ // The standard = operator. This make a full / proper copy of
+ // this class.
+ // The standard Copy constructor. This make a full / proper copy of
+ // this class.
+ // Inputs:
+ // AliITSgeomMatrix &source The source of this copy
+ // Outputs:
+ // none.
+ // Return:
+ // A copy of the source AliITSgeomMatrix class.
Int_t i,j;
this->fDetectorIndex = sourse.fDetectorIndex;
this->fCylPhi = sourse.fCylPhi;
for(j=0;j<3;j++) this->fm[i][j] = sourse.fm[i][j];
}// end for i
+ this->fPath = sourse.fPath;
}
//----------------------------------------------------------------------
AliITSgeomMatrix::AliITSgeomMatrix(Int_t idt,const Int_t id[3],
- const Double_t rot[3],const Double_t tran[3]){
-////////////////////////////////////////////////////////////////////////
-// This is a constructor for the AliITSgeomMatrix class. The matrix is
-// defined by 3 standard rotation angles [radians], and the translation
-// vector tran [cm]. In addition the layer, ladder, and detector number
-// for this particular module and the type of module must be given.
-// The full rotation matrix is kept so that the evaluation
-// of a coordinate transformation can be done quickly and with a minimum
-// of CPU overhead. The basic coordinate systems are the ALICE global
-// coordinate system and the detector local coordinate system. In general
-// this structure is not limited to just those two coordinate systems.
-//Begin_Html
-/*
-<img src="picts/ITS/AliISgeomMatrix_L1.gif">
-*/
-//End_Html
-////////////////////////////////////////////////////////////////////////
+ const Double_t rot[3],const Double_t tran[3]):
+TObject(),
+fDetectorIndex(0), // Detector type index (like fShapeIndex was)
+fid(), // layer, ladder, detector numbers.
+frot(), //! vector of rotations about x,y,z [radians].
+ftran(), // Translation vector of module x,y,z.
+fCylR(0.0), //! R Translation in Cylinderical coordinates
+fCylPhi(0.0),//! Phi Translation vector in Cylindrical coord.
+fm(), // Rotation matrix based on frot.
+fPath(){ // Path in geometry to this moduel
+ // This is a constructor for the AliITSgeomMatrix class. The matrix is
+ // defined by 3 standard rotation angles [radians], and the translation
+ // vector tran [cm]. In addition the layer, ladder, and detector number
+ // for this particular module and the type of module must be given.
+ // The full rotation matrix is kept so that the evaluation
+ // of a coordinate transformation can be done quickly and with a minimum
+ // of CPU overhead. The basic coordinate systems are the ALICE global
+ // coordinate system and the detector local coordinate system. In general
+ // this structure is not limited to just those two coordinate systems.
+ //Begin_Html
+ /*
+ <img src="picts/ITS/AliITSgeomMatrix_L1.gif">
+ */
+ //End_Html
+ // Inputs:
+ // Int_t idt The detector index value
+ // Int_t id[3] The layer, ladder, and detector numbers
+ // Double_t rot[3] The 3 Cartician rotaion angles [radians]
+ // Double_t tran[3] The 3 Cartician translation distnaces
+ // Outputs:
+ // none.
+ // Return:
+ // A properly inilized AliITSgeomMatrix class.
Int_t i;
fDetectorIndex = idt; // a value never defined.
//----------------------------------------------------------------------
AliITSgeomMatrix::AliITSgeomMatrix(Int_t idt, const Int_t id[3],
Double_t matrix[3][3],
- const Double_t tran[3]){
-////////////////////////////////////////////////////////////////////////
-// This is a constructor for the AliITSgeomMatrix class. The rotation matrix
-// is given as one of the inputs, and the translation vector tran [cm]. In
-// addition the layer, ladder, and detector number for this particular
-// module and the type of module must be given. The full rotation matrix
-// is kept so that the evaluation of a coordinate transformation can be
-// done quickly and with a minimum of CPU overhead. The basic coordinate
-// systems are the ALICE global coordinate system and the detector local
-// coordinate system. In general this structure is not limited to just
-// those two coordinate systems.
-//Begin_Html
-/*
-<img src="picts/ITS/AliISgeomMatrix_L1.gif">
-*/
-//End_Html
-////////////////////////////////////////////////////////////////////////
+ const Double_t tran[3]):
+TObject(),
+fDetectorIndex(0), // Detector type index (like fShapeIndex was)
+fid(), // layer, ladder, detector numbers.
+frot(), //! vector of rotations about x,y,z [radians].
+ftran(), // Translation vector of module x,y,z.
+fCylR(0.0), //! R Translation in Cylinderical coordinates
+fCylPhi(0.0),//! Phi Translation vector in Cylindrical coord.
+fm(), // Rotation matrix based on frot.
+fPath(){ // Path in geometry to this module
+ // This is a constructor for the AliITSgeomMatrix class. The
+ // rotation matrix is given as one of the inputs, and the
+ // translation vector tran [cm]. In addition the layer, ladder,
+ // and detector number for this particular module and the type of
+ // module must be given. The full rotation matrix is kept so that
+ // the evaluation of a coordinate transformation can be done quickly
+ // and with a minimum of CPU overhead. The basic coordinate systems
+ // are the ALICE global coordinate system and the detector local
+ // coordinate system. In general this structure is not limited to just
+ // those two coordinate systems.
+ //Begin_Html
+ /*
+ <img src="picts/ITS/AliITSgeomMatrix_L1.gif">
+ */
+ //End_Html
+ // Inputs:
+ // Int_t idt The detector index value
+ // Int_t id[3] The layer, ladder, and detector numbers
+ // Double_t rot[3][3] The 3x3 Cartician rotaion matrix
+ // Double_t tran[3] The 3 Cartician translation distnaces
+ // Outputs:
+ // none.
+ // Return:
+ // A properly inilized AliITSgeomMatrix class.
Int_t i,j;
fDetectorIndex = idt; // a value never defined.
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::SixAnglesFromMatrix(Double_t *ang){
-////////////////////////////////////////////////////////////////////////
-// This function returns the 6 GEANT 3.21 rotation angles [degrees] in
-// the array ang which must be at least [6] long.
-////////////////////////////////////////////////////////////////////////
+ // This function returns the 6 GEANT 3.21 rotation angles [degrees] in
+ // the array ang which must be at least [6] long.
+ // Inputs:
+ // none.
+ // Outputs:
+ // Double_t ang[6] The 6 Geant3.21 rotation angles. [degrees]
+ // Return:
+ // noting
Double_t si,c=180./TMath::Pi();
ang[1] = TMath::ATan2(fm[0][1],fm[0][0]);
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::MatrixFromSixAngles(const Double_t *ang){
-////////////////////////////////////////////////////////////////////////
-// Given the 6 GEANT 3.21 rotation angles [degree], this will compute and
-// set the rotations matrix and 3 standard rotation angles [radians].
-// These angles and rotation matrix are overwrite the existing values in
-// this class.
-////////////////////////////////////////////////////////////////////////
+ // Given the 6 GEANT 3.21 rotation angles [degree], this will compute and
+ // set the rotations matrix and 3 standard rotation angles [radians].
+ // These angles and rotation matrix are overwrite the existing values in
+ // this class.
+ // Inputs:
+ // Double_t ang[6] The 6 Geant3.21 rotation angles. [degrees]
+ // Outputs:
+ // none.
+ // Return:
+ // noting
Int_t i,j;
Double_t si,lr[9],c=TMath::Pi()/180.;
//----------------------------------------------------------------------
AliITSgeomMatrix::AliITSgeomMatrix(const Double_t rotd[6]/*degrees*/,
Int_t idt,const Int_t id[3],
- const Double_t tran[3]){
-////////////////////////////////////////////////////////////////////////
-// This is a constructor for the AliITSgeomMatrix class. The matrix is
-// defined by the 6 GEANT 3.21 rotation angles [degrees], and the translation
-// vector tran [cm]. In addition the layer, ladder, and detector number
-// for this particular module and the type of module must be given.
-// The full rotation matrix is kept so that the evaluation
-// of a coordinate transformation can be done quickly and with a minimum
-// of CPU overhead. The basic coordinate systems are the ALICE global
-// coordinate system and the detector local coordinate system. In general
-// this structure is not limited to just those two coordinate systems.
-//Begin_Html
-/*
-<img src="picts/ITS/AliISgeomMatrix_L1.gif">
-*/
-//End_Html
-////////////////////////////////////////////////////////////////////////
+ const Double_t tran[3]){
+ // This is a constructor for the AliITSgeomMatrix class. The matrix
+ // is defined by the 6 GEANT 3.21 rotation angles [degrees], and
+ // the translation vector tran [cm]. In addition the layer, ladder,
+ // and detector number for this particular module and the type of
+ // module must be given. The full rotation matrix is kept so that
+ // the evaluation of a coordinate transformation can be done
+ // quickly and with a minimum of CPU overhead. The basic coordinate
+ // systems are the ALICE global coordinate system and the detector
+ // local coordinate system. In general this structure is not limited
+ // to just those two coordinate systems.
+ //Begin_Html
+ /*
+ <img src="picts/ITS/AliITSgeomMatrix_L1.gif">
+ */
+ //End_Html
+ // Inputs:
+ // Double_t rotd[6] The 6 Geant 3.21 rotation angles [degrees]
+ // Int_t idt The module Id number
+ // Int_t id[3] The layer, ladder and detector number
+ // Double_t tran[3] The translation vector
Int_t i;
fDetectorIndex = idt; // a value never defined.
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::AngleFromMatrix(){
-////////////////////////////////////////////////////////////////////////
-// Computes the angles from the rotation matrix up to a phase of 180 degrees.
-////////////////////////////////////////////////////////////////////////
+ // Computes the angles from the rotation matrix up to a phase of
+ // 180 degrees.
+ // Inputs:
+ // none
+ // Outputs:
+ // none
+ // Return:
+ // none
Double_t rx,ry,rz;
// get angles from matrix up to a phase of 180 degrees.
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::MatrixFromAngle(){
-////////////////////////////////////////////////////////////////////////
-// Computes the Rotation matrix from the angles [radians] kept in this
-// class.
-////////////////////////////////////////////////////////////////////////
+ // Computes the Rotation matrix from the angles [radians] kept in this
+ // class.
+ // Inputs:
+ // none
+ // Outputs:
+ // none
+ // Return:
+ // none
Double_t sx,sy,sz,cx,cy,cz;
sx = TMath::Sin(frot[0]); cx = TMath::Cos(frot[0]);
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::GtoLPosition(const Double_t g0[3],Double_t l[3]) const {
-////////////////////////////////////////////////////////////////////////
-// Returns the local coordinates given the global coordinates [cm].
-////////////////////////////////////////////////////////////////////////
+ // Returns the local coordinates given the global coordinates [cm].
+ // Inputs:
+ // Double_t g[3] The position represented in the ALICE
+ // global coordinate system
+ // Outputs:
+ // Double_t l[3] The poistion represented in the local
+ // detector coordiante system
+ // Return:
+ // none
Int_t i,j;
Double_t g[3];
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::LtoGPosition(const Double_t l[3],Double_t g[3]) const {
-////////////////////////////////////////////////////////////////////////
-// Returns the global coordinates given the local coordinates [cm].
-////////////////////////////////////////////////////////////////////////
+ // Returns the global coordinates given the local coordinates [cm].
+ // Inputs:
+ // Double_t l[3] The poistion represented in the detector
+ // local coordinate system
+ // Outputs:
+ // Double_t g[3] The poistion represented in the ALICE
+ // Global coordinate system
+ // Return:
+ // none.
Int_t i,j;
for(i=0;i<3;i++){
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::GtoLMomentum(const Double_t g[3],Double_t l[3]) const{
-////////////////////////////////////////////////////////////////////////
-// Returns the local coordinates of the momentum given the global
-// coordinates of the momentum. It transforms just like GtoLPosition
-// except that the translation vector is zero.
-////////////////////////////////////////////////////////////////////////
+ // Returns the local coordinates of the momentum given the global
+ // coordinates of the momentum. It transforms just like GtoLPosition
+ // except that the translation vector is zero.
+ // Inputs:
+ // Double_t g[3] The momentum represented in the ALICE global
+ // coordinate system
+ // Outputs:
+ // Double_t l[3] the momentum represented in the detector
+ // local coordinate system
+ // Return:
+ // none.
Int_t i,j;
for(i=0;i<3;i++){
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::LtoGMomentum(const Double_t l[3],Double_t g[3]) const {
-////////////////////////////////////////////////////////////////////////
-// Returns the Global coordinates of the momentum given the local
-// coordinates of the momentum. It transforms just like LtoGPosition
-// except that the translation vector is zero.
-////////////////////////////////////////////////////////////////////////
+ // Returns the Global coordinates of the momentum given the local
+ // coordinates of the momentum. It transforms just like LtoGPosition
+ // except that the translation vector is zero.
+ // Inputs:
+ // Double_t l[3] the momentum represented in the detector
+ // local coordinate system
+ // Outputs:
+ // Double_t g[3] The momentum represented in the ALICE global
+ // coordinate system
+ // Return:
+ // none.
Int_t i,j;
for(i=0;i<3;i++){
return;
}
//----------------------------------------------------------------------
-void AliITSgeomMatrix::GtoLPositionError( Double_t g[3][3],
- Double_t l[3][3]) const {
-////////////////////////////////////////////////////////////////////////
-// Given an Uncertainty matrix in Global coordinates it is rotated so that
-// its representation in local coordinates can be returned. There is no
-// effect due to the translation vector or its uncertainty.
-////////////////////////////////////////////////////////////////////////
+void AliITSgeomMatrix::GtoLPositionError(const Double_t g[3][3],
+ Double_t l[3][3]) const {
+ // Given an Uncertainty matrix in Global coordinates it is
+ // rotated so that its representation in local coordinates can
+ // be returned. There is no effect due to the translation vector
+ // or its uncertainty.
+ // Inputs:
+ // Double_t g[3][3] The error matrix represented in the ALICE global
+ // coordinate system
+ // Outputs:
+ // Double_t l[3][3] the error matrix represented in the detector
+ // local coordinate system
+ // Return:
+ // none.
Int_t i,j,k,m;
for(i=0;i<3;i++)for(m=0;m<3;m++){
return;
}
//----------------------------------------------------------------------
-void AliITSgeomMatrix::LtoGPositionError( Double_t l[3][3],
+void AliITSgeomMatrix::LtoGPositionError(const Double_t l[3][3],
Double_t g[3][3]) const {
-////////////////////////////////////////////////////////////////////////
-// Given an Uncertainty matrix in Local coordinates it is rotated so that
-// its representation in global coordinates can be returned. There is no
-// effect due to the translation vector or its uncertainty.
-////////////////////////////////////////////////////////////////////////
+ // Given an Uncertainty matrix in Local coordinates it is rotated so that
+ // its representation in global coordinates can be returned. There is no
+ // effect due to the translation vector or its uncertainty.
+ // Inputs:
+ // Double_t l[3][3] the error matrix represented in the detector
+ // local coordinate system
+ // Outputs:
+ // Double_t g[3][3] The error matrix represented in the ALICE global
+ // coordinate system
+ // Return:
+ // none.
Int_t i,j,k,m;
for(i=0;i<3;i++)for(m=0;m<3;m++){
return;
}
//----------------------------------------------------------------------
-void AliITSgeomMatrix::GtoLPositionTracking(const Double_t g0[3],
- Double_t l[3]) const {
-////////////////////////////////////////////////////////////////////////
-// A slightly different coordinate system is used when tracking.
-// This coordinate system is only relevant when the geometry represents
-// the cylindrical ALICE ITS geometry. For tracking the Z axis is left
-// alone but X -> -Y and Y -> X such that X always points out of the
-// ITS Cylinder for every layer including layer 1 (where the detector
-// are mounted upside down).
-//Begin_Html
-/*
-<img src="picts/ITS/AliITSgeomMatrix_T1.gif">
- */
-//End_Html
-////////////////////////////////////////////////////////////////////////
+void AliITSgeomMatrix::GtoLPositionTracking(const Double_t g[3],
+ Double_t l[3]) const {
+ // A slightly different coordinate system is used when tracking.
+ // This coordinate system is only relevant when the geometry represents
+ // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
+ // alone but X -> -Y and Y -> X such that X always points out of the
+ // ITS Cylinder for every layer including layer 1 (where the detector
+ // are mounted upside down).
+ //Begin_Html
+ /*
+ <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
+ */
+ //End_Html
+ // Inputs:
+ // Double_t g[3] The position represented in the ALICE
+ // global coordinate system
+ // Outputs:
+ // Double_t l[3] The poistion represented in the local
+ // detector coordiante system
+ // Return:
+ // none
Double_t l0[3];
- this->GtoLPosition(g0,l0);
+ this->GtoLPosition(g,l0);
if(fid[0]==1){ // for layer 1 the detector are flipped upside down
// with respect to the others.
l[0] = +l0[1];
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::LtoGPositionTracking(const Double_t l[3],
- Double_t g[3]) const {
-////////////////////////////////////////////////////////////////////////
-// A slightly different coordinate system is used when tracking.
-// This coordinate system is only relevant when the geometry represents
-// the cylindrical ALICE ITS geometry. For tracking the Z axis is left
-// alone but X -> -Y and Y -> X such that X always points out of the
-// ITS Cylinder for every layer including layer 1 (where the detector
-// are mounted upside down).
-//Begin_Html
-/*
-<img src="picts/ITS/AliITSgeomMatrix_T1.gif">
- */
-//End_Html
-////////////////////////////////////////////////////////////////////////
+ Double_t g[3]) const {
+ // A slightly different coordinate system is used when tracking.
+ // This coordinate system is only relevant when the geometry represents
+ // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
+ // alone but X -> -Y and Y -> X such that X always points out of the
+ // ITS Cylinder for every layer including layer 1 (where the detector
+ // are mounted upside down).
+ //Begin_Html
+ /*
+ <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
+ */
+ //End_Html
+ // Inputs:
+ // Double_t l[3] The poistion represented in the detector
+ // local coordinate system
+ // Outputs:
+ // Double_t g[3] The poistion represented in the ALICE
+ // Global coordinate system
+ // Return:
+ // none.
Double_t l0[3];
if(fid[0]==1){ // for layer 1 the detector are flipped upside down
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::GtoLMomentumTracking(const Double_t g[3],
- Double_t l[3]) const {
-////////////////////////////////////////////////////////////////////////
-// A slightly different coordinate system is used when tracking.
-// This coordinate system is only relevant when the geometry represents
-// the cylindrical ALICE ITS geometry. For tracking the Z axis is left
-// alone but X -> -Y and Y -> X such that X always points out of the
-// ITS Cylinder for every layer including layer 1 (where the detector
-// are mounted upside down).
-//Begin_Html
-/*
-<img src="picts/ITS/AliITSgeomMatrix_T1.gif">
- */
-//End_Html
-////////////////////////////////////////////////////////////////////////
+ Double_t l[3]) const {
+ // A slightly different coordinate system is used when tracking.
+ // This coordinate system is only relevant when the geometry represents
+ // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
+ // alone but X -> -Y and Y -> X such that X always points out of the
+ // ITS Cylinder for every layer including layer 1 (where the detector
+ // are mounted upside down).
+ //Begin_Html
+ /*
+ <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
+ */
+ //End_Html
+ // Inputs:
+ // Double_t g[3] The momentum represented in the ALICE global
+ // coordinate system
+ // Outputs:
+ // Double_t l[3] the momentum represented in the detector
+ // local coordinate system
+ // Return:
+ // none.
Double_t l0[3];
this->GtoLMomentum(g,l0);
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::LtoGMomentumTracking(const Double_t l[3],
- Double_t g[3]) const {
-////////////////////////////////////////////////////////////////////////
-// A slightly different coordinate system is used when tracking.
-// This coordinate system is only relevant when the geometry represents
-// the cylindrical ALICE ITS geometry. For tracking the Z axis is left
-// alone but X -> -Y and Y -> X such that X always points out of the
-// ITS Cylinder for every layer including layer 1 (where the detector
-// are mounted upside down).
-//Begin_Html
-/*
-<img src="picts/ITS/AliITSgeomMatrix_T1.gif">
- */
-//End_Html
-////////////////////////////////////////////////////////////////////////
+ Double_t g[3]) const {
+ // A slightly different coordinate system is used when tracking.
+ // This coordinate system is only relevant when the geometry represents
+ // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
+ // alone but X -> -Y and Y -> X such that X always points out of the
+ // ITS Cylinder for every layer including layer 1 (where the detector
+ // are mounted upside down).
+ //Begin_Html
+ /*
+ <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
+ */
+ //End_Html
+ // Inputs:
+ // Double_t l[3] the momentum represented in the detector
+ // local coordinate system
+ // Outputs:
+ // Double_t g[3] The momentum represented in the ALICE global
+ // coordinate system
+ // Return:
+ // none.
Double_t l0[3];
if(fid[0]==1){ // for layer 1 the detector are flipped upside down
return;
}
//----------------------------------------------------------------------
-void AliITSgeomMatrix::GtoLPositionErrorTracking( Double_t g[3][3],
- Double_t l[3][3]) const {
-////////////////////////////////////////////////////////////////////////
-// A slightly different coordinate system is used when tracking.
-// This coordinate system is only relevant when the geometry represents
-// the cylindrical ALICE ITS geometry. For tracking the Z axis is left
-// alone but X -> -Y and Y -> X such that X always points out of the
-// ITS Cylinder for every layer including layer 1 (where the detector
-// are mounted upside down).
-//Begin_Html
-/*
-<img src="picts/ITS/AliITSgeomMatrix_T1.gif">
- */
-//End_Html
-////////////////////////////////////////////////////////////////////////
+void AliITSgeomMatrix::GtoLPositionErrorTracking(const Double_t g[3][3],
+ Double_t l[3][3]) const {
+ // A slightly different coordinate system is used when tracking.
+ // This coordinate system is only relevant when the geometry represents
+ // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
+ // alone but X -> -Y and Y -> X such that X always points out of the
+ // ITS Cylinder for every layer including layer 1 (where the detector
+ // are mounted upside down).
+ //Begin_Html
+ /*
+ <img src="picts/ITS/AliITSgeomMatrix_TE1.gif">
+ */
+ //End_Html
+ // Inputs:
+ // Double_t g[3][3] The error matrix represented in the ALICE global
+ // coordinate system
+ // Outputs:
+ // Double_t l[3][3] the error matrix represented in the detector
+ // local coordinate system
+ // Return:
Int_t i,j,k,m;
Double_t rt[3][3];
Double_t a0[3][3] = {{0.,+1.,0.},{-1.,0.,0.},{0.,0.,+1.}};
return;
}
//----------------------------------------------------------------------
-void AliITSgeomMatrix::LtoGPositionErrorTracking( Double_t l[3][3],
- Double_t g[3][3]) const {
-////////////////////////////////////////////////////////////////////////
-// A slightly different coordinate system is used when tracking.
-// This coordinate system is only relevant when the geometry represents
-// the cylindrical ALICE ITS geometry. For tracking the Z axis is left
-// alone but X -> -Y and Y -> X such that X always points out of the
-// ITS Cylinder for every layer including layer 1 (where the detector
-// are mounted upside down).
-//Begin_Html
-/*
-<img src="picts/ITS/AliITSgeomMatrix_T1.gif">
- */
-//End_Html
-////////////////////////////////////////////////////////////////////////
+void AliITSgeomMatrix::LtoGPositionErrorTracking(const Double_t l[3][3],
+ Double_t g[3][3]) const {
+ // A slightly different coordinate system is used when tracking.
+ // This coordinate system is only relevant when the geometry represents
+ // the cylindrical ALICE ITS geometry. For tracking the Z axis is left
+ // alone but X -> -Y and Y -> X such that X always points out of the
+ // ITS Cylinder for every layer including layer 1 (where the detector
+ // are mounted upside down).
+ //Begin_Html
+ /*
+ <img src="picts/ITS/AliITSgeomMatrix_TE1.gif">
+ */
+ //End_Html
+ // Inputs:
+ // Double_t l[3][3] the error matrix represented in the detector
+ // local coordinate system
+ // Outputs:
+ // Double_t g[3][3] The error matrix represented in the ALICE global
+ // coordinate system
+ // Return:
+ // none.
Int_t i,j,k,m;
Double_t rt[3][3];
Double_t a0[3][3] = {{0.,+1.,0.},{-1.,0.,0.},{0.,0.,+1.}};
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::PrintTitles(ostream *os) const {
-////////////////////////////////////////////////////////////////////////
-// Standard output format for this class but it includes variable
-// names and formatting that makes it easer to read.
-////////////////////////////////////////////////////////////////////////
+ // Standard output format for this class but it includes variable
+ // names and formatting that makes it easer to read.
+ // Inputs:
+ // ostream *os The output stream to print the title on
+ // Outputs:
+ // none.
+ // Return:
+ // none.
Int_t i,j;
*os << "fDetectorIndex=" << fDetectorIndex << " fid[3]={";
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::PrintComment(ostream *os) const {
-////////////////////////////////////////////////////////////////////////
-// output format used by Print..
-////////////////////////////////////////////////////////////////////////
+ // output format used by Print.
+ // Inputs:
+ // ostream *os The output stream to print the comments on
+ // Outputs:
+ // none.
+ // Return:
+ // none.
*os << "fDetectorIndex fid[0] fid[1] fid[2] ftran[0] ftran[1] ftran[2] ";
*os << "fm[0][0] fm[0][1] fm[0][2] fm[1][0] fm[1][1] fm[1][2] ";
*os << "fm[2][0] fm[2][1] fm[2][2] ";
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::Print(ostream *os){
-////////////////////////////////////////////////////////////////////////
-// Standard output format for this class.
-////////////////////////////////////////////////////////////////////////
+ // Standard output format for this class.
+ // Inputs:
+ // ostream *os The output stream to print the class data on
+ // Outputs:
+ // none.
+ // Return:
+ // none.
Int_t i,j;
#if defined __GNUC__
#if __GNUC__ > 2
for(i=0;i<3;i++) *os << setprecision(16) << ftran[i] << " ";
for(i=0;i<3;i++)for(j=0;j<3;j++) *os << setprecision(16) <<
fm[i][j] << " ";
+ *os << fPath.Length()<< " ";
+ for(i=0;i<fPath.Length();i++) *os << fPath[i];
*os << endl;
os->flags(fmt); // reset back to old formating.
return;
}
//----------------------------------------------------------------------
void AliITSgeomMatrix::Read(istream *is){
-////////////////////////////////////////////////////////////////////////
-// Standard input format for this class.
-////////////////////////////////////////////////////////////////////////
+ // Standard input format for this class.
+ // Inputs:
+ // istream *is The input stream to read on
+ // Outputs:
+ // none.
+ // Return:
+ // none.
Int_t i,j;
*is >> fDetectorIndex;
// for(i=0;i<3;i++) *is >> frot[i]; // Redundant with fm[][].
for(i=0;i<3;i++) *is >> ftran[i];
for(i=0;i<3;i++)for(j=0;j<3;j++) *is >> fm[i][j];
+ *is >> j; // string length
+ fPath.Resize(j);
+ for(i=0;i<j;i++) {*is >> fPath[i];}
AngleFromMatrix(); // compute angles frot[].
fCylR = TMath::Sqrt(ftran[0]*ftran[0]+ftran[1]*ftran[1]);
fCylPhi = TMath::ATan2(ftran[1],ftran[0]);
//______________________________________________________________________
void AliITSgeomMatrix::Streamer(TBuffer &R__b){
// Stream an object of class AliITSgeomMatrix.
+ // Inputs:
+ // TBuffer &R__b The output buffer to stream data on.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
- if (R__b.IsReading()) {
- AliITSgeomMatrix::Class()->ReadBuffer(R__b, this);
- fCylR = TMath::Sqrt(ftran[0]*ftran[0]+ftran[1]*ftran[1]);
- fCylPhi = TMath::ATan2(ftran[1],ftran[0]);
- this->AngleFromMatrix();
- if(fCylPhi<0.0) fCylPhi += TMath::Pi();
- } else {
- AliITSgeomMatrix::Class()->WriteBuffer(R__b, this);
- }
+ if (R__b.IsReading()) {
+ AliITSgeomMatrix::Class()->ReadBuffer(R__b, this);
+ fCylR = TMath::Sqrt(ftran[0]*ftran[0]+ftran[1]*ftran[1]);
+ fCylPhi = TMath::ATan2(ftran[1],ftran[0]);
+ this->AngleFromMatrix();
+ if(fCylPhi<0.0) fCylPhi += TMath::Pi();
+ } else {
+ AliITSgeomMatrix::Class()->WriteBuffer(R__b, this);
+ } // end if
}
//______________________________________________________________________
void AliITSgeomMatrix::SetTranslation(const Double_t tran[3]){
- // Sets the translation vector and computes fCylR and fCylPhi.
- for(Int_t i=0;i<3;i++) ftran[i] = tran[i];
- fCylR = TMath::Sqrt(ftran[0]*ftran[0]+ftran[1]*ftran[1]);
- fCylPhi = TMath::ATan2(ftran[1],ftran[0]);
- if(fCylPhi<0.0) fCylPhi += TMath::Pi();
+ // Sets the translation vector and computes fCylR and fCylPhi.
+ // Inputs:
+ // Double_t trans[3] The translation vector to be used
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+ for(Int_t i=0;i<3;i++) ftran[i] = tran[i];
+ fCylR = TMath::Sqrt(ftran[0]*ftran[0]+ftran[1]*ftran[1]);
+ fCylPhi = TMath::ATan2(ftran[1],ftran[0]);
+ if(fCylPhi<0.0) fCylPhi += TMath::Pi();
+}
+//----------------------------------------------------------------------
+TPolyLine3D* AliITSgeomMatrix::CreateLocalAxis(){
+ // This class is used as part of the documentation of this class
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // A pointer to a new TPolyLine3D object showing the 3 line
+ // segments that make up the this local axis in the global
+ // reference system.
+ Float_t gf[15];
+ Double_t g[5][3];
+ Double_t l[5][3]={{1.0,0.0,0.0},{0.0,0.0,0.0},{0.0,1.0,0.0},{0.0,0.0,0.0},
+ {0.0,0.0,1.0}};
+ Int_t i;
+
+ for(i=0;i<5;i++) {
+ LtoGPosition(l[i],g[i]);
+ gf[3*i]=(Float_t)g[i][0];
+ gf[3*i+1]=(Float_t)g[i][1];
+ gf[3*i+2]=(Float_t)g[i][2];
+ } // end for i
+ return new TPolyLine3D(5,gf);
+}
+//----------------------------------------------------------------------
+TPolyLine3D* AliITSgeomMatrix::CreateLocalAxisTracking(){
+ // This class is used as part of the documentation of this class
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // A pointer to a new TPolyLine3D object showing the 3 line
+ // segments that make up the this local axis in the global
+ // reference system.
+ Float_t gf[15];
+ Double_t g[5][3];
+ Double_t l[5][3]={{1.0,0.0,0.0},{0.0,0.0,0.0},{0.0,1.0,0.0},{0.0,0.0,0.0},
+ {0.0,0.0,1.0}};
+ Int_t i;
+
+ for(i=0;i<5;i++) {
+ LtoGPositionTracking(l[i],g[i]);
+ gf[3*i]=(Float_t)g[i][0];
+ gf[3*i+1]=(Float_t)g[i][1];
+ gf[3*i+2]=(Float_t)g[i][2];
+ } // end for i
+ return new TPolyLine3D(5,gf);
+}
+//----------------------------------------------------------------------
+TNode* AliITSgeomMatrix::CreateNode(const Char_t *nodeName,
+ const Char_t *nodeTitle,TNode *mother,
+ TShape *shape,Bool_t axis){
+ // Creates a node inside of the node mother out of the shape shape
+ // in the position, with respect to mother, indecated by "this". If axis
+ // is ture, it will insert an axis within this node/shape.
+ // Inputs:
+ // Char_t *nodeName This name of this node
+ // Char_t *nodeTitle This node title
+ // TNode *mother The node this node will be inside of/with respect to
+ // TShape *shape The shape of this node
+ // Bool_t axis If ture, a set of x,y,z axis will be included
+ // Outputs:
+ // none.
+ // Return:
+ // A pointer to "this" node.
+ Double_t trans[3],matrix[3][3],*matr;
+ TRotMatrix *rot = new TRotMatrix();
+ TString name,title;
+
+ matr = &(matrix[0][0]);
+ this->GetTranslation(trans);
+ this->GetMatrix(matrix);
+ rot->SetMatrix(matr);
+ //
+ name = nodeName;
+ title = nodeTitle;
+ //
+ mother->cd();
+ TNode *node1 = new TNode(name.Data(),title.Data(),shape,trans[0],trans[1],trans[2],rot);
+ if(axis){
+ Int_t i,j;
+ const Float_t scale=0.5,lw=0.2;
+ Float_t xchar[13][2]={{0.5*lw,1.},{0.,0.5*lw},{0.5-0.5*lw,0.5},
+ {0.,0.5*lw},{0.5*lw,0.},{0.5,0.5-0.5*lw},
+ {1-0.5*lw,0.},{1.,0.5*lw},{0.5+0.5*lw,0.5},
+ {1.,1.-0.5*lw},{1.-0.5*lw,1.},{0.5,0.5+0.5*lw},
+ {0.5*lw,1.}};
+ Float_t ychar[10][2]={{.5-0.5*lw,0.},{.5+0.5*lw,0.},{.5+0.5*lw,0.5-0.5*lw},
+ {1.,1.-0.5*lw},{1.-0.5*lw,1.},{0.5+0.5*lw,0.5},
+ {0.5*lw,1.} ,{0.,1-0.5*lw} ,{0.5-0.5*lw,0.5},
+ {.5-0.5*lw,0.}};
+ Float_t zchar[11][2]={{0.,1.},{0,1.-lw},{1.-lw,1.-lw},{0.,lw} ,{0.,0.},
+ {1.,0.},{1.,lw} ,{lw,lw} ,{1.,1.-lw},{1.,1.},
+ {0.,1.}};
+ for(i=0;i<13;i++)for(j=0;j<2;j++){
+ if(i<13) xchar[i][j] = scale*xchar[i][j];
+ if(i<10) ychar[i][j] = scale*ychar[i][j];
+ if(i<11) zchar[i][j] = scale*zchar[i][j];
+ } // end for i,j
+ TXTRU *axisxl = new TXTRU("x","x","text",12,2);
+ for(i=0;i<12;i++) axisxl->DefineVertex(i,xchar[i][0],xchar[i][1]);
+ axisxl->DefineSection(0,-0.5*lw);axisxl->DefineSection(1,0.5*lw);
+ TXTRU *axisyl = new TXTRU("y","y","text",9,2);
+ for(i=0;i<9;i++) axisyl->DefineVertex(i,ychar[i][0],ychar[i][1]);
+ axisyl->DefineSection(0,-0.5*lw);axisyl->DefineSection(1,0.5*lw);
+ TXTRU *axiszl = new TXTRU("z","z","text",10,2);
+ for(i=0;i<10;i++) axiszl->DefineVertex(i,zchar[i][0],zchar[i][1]);
+ axiszl->DefineSection(0,-0.5*lw);axiszl->DefineSection(1,0.5*lw);
+ Float_t lxy[13][2]={{-0.5*lw,-0.5*lw},{0.8,-0.5*lw},{0.8,-0.1},{1.0,0.0},
+ {0.8,0.1},{0.8,0.5*lw},{0.5*lw,0.5*lw},{0.5*lw,0.8},
+ {0.1,0.8},{0.0,1.0},{-0.1,0.8},{-0.5*lw,0.8},
+ {-0.5*lw,-0.5*lw}};
+ TXTRU *axisxy = new TXTRU("axisxy","axisxy","text",13,2);
+ for(i=0;i<13;i++) axisxy->DefineVertex(i,lxy[i][0],lxy[i][1]);
+ axisxy->DefineSection(0,-0.5*lw);axisxy->DefineSection(1,0.5*lw);
+ Float_t lz[8][2]={{0.5*lw,-0.5*lw},{0.8,-0.5*lw},{0.8,-0.1},{1.0,0.0},
+ {0.8,0.1},{0.8,0.5*lw},{0.5*lw,0.5*lw},
+ {0.5*lw,-0.5*lw}};
+ TXTRU *axisz = new TXTRU("axisz","axisz","text",8,2);
+ for(i=0;i<8;i++) axisz->DefineVertex(i,lz[i][0],lz[i][1]);
+ axisz->DefineSection(0,-0.5*lw);axisz->DefineSection(1,0.5*lw);
+ //TRotMatrix *xaxis90= new TRotMatrix("xaixis90","",90.0, 0.0, 0.0);
+ TRotMatrix *yaxis90= new TRotMatrix("yaixis90","", 0.0,90.0, 0.0);
+ TRotMatrix *zaxis90= new TRotMatrix("zaixis90","", 0.0, 0.0,90.0);
+ //
+ node1->cd();
+ title = name.Append("axisxy");
+ TNode *nodeaxy = new TNode(title.Data(),title.Data(),axisxy);
+ title = name.Append("axisz");
+ TNode *nodeaz = new TNode(title.Data(),title.Data(),axisz,0.,0.,0.,yaxis90);
+ TNode *textboxX0 = new TNode("textboxX0","textboxX0",axisxl,
+ lxy[3][0],lxy[3][1],0.0);
+ TNode *textboxX1 = new TNode("textboxX1","textboxX1",axisxl,
+ lxy[3][0],lxy[3][1],0.0,yaxis90);
+ TNode *textboxX2 = new TNode("textboxX2","textboxX2",axisxl,
+ lxy[3][0],lxy[3][1],0.0,zaxis90);
+ TNode *textboxY0 = new TNode("textboxY0","textboxY0",axisyl,
+ lxy[9][0],lxy[9][1],0.0);
+ TNode *textboxY1 = new TNode("textboxY1","textboxY1",axisyl,
+ lxy[9][0],lxy[9][1],0.0,yaxis90);
+ TNode *textboxY2 = new TNode("textboxY2","textboxY2",axisyl,
+ lxy[9][0],lxy[9][1],0.0,zaxis90);
+ TNode *textboxZ0 = new TNode("textboxZ0","textboxZ0",axiszl,
+ 0.0,0.0,lz[3][0]);
+ TNode *textboxZ1 = new TNode("textboxZ1","textboxZ1",axiszl,
+ 0.0,0.0,lz[3][0],yaxis90);
+ TNode *textboxZ2 = new TNode("textboxZ2","textboxZ2",axiszl,
+ 0.0,0.0,lz[3][0],zaxis90);
+ nodeaxy->Draw();
+ nodeaz->Draw();
+ textboxX0->Draw();
+ textboxX1->Draw();
+ textboxX2->Draw();
+ textboxY0->Draw();
+ textboxY1->Draw();
+ textboxY2->Draw();
+ textboxZ0->Draw();
+ textboxZ1->Draw();
+ textboxZ2->Draw();
+ } // end if
+ mother->cd();
+ return node1;
}
+//----------------------------------------------------------------------
+void AliITSgeomMatrix::MakeFigures(){
+ // make figures to help document this class
+ // Inputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+ const Double_t dx0=550.,dy0=550.,dz0=550.; // cm
+ const Double_t dx=1.0,dy=0.300,dz=3.0,rmax=0.1; // cm
+ Float_t l[5][3]={{1.0,0.0,0.0},{0.0,0.0,0.0},{0.0,1.0,0.0},{0.0,0.0,0.0},
+ {0.0,0.0,1.0}};
+ TCanvas *c = new TCanvas(kFALSE);// create a batch mode canvas.
+ TView *view = new TView(1); // Create Cartesian coordiante view
+ TBRIK *mother = new TBRIK("Mother","Mother","void",dx0,dy0,dz0);
+ TBRIK *det = new TBRIK("Detector","","Si",dx,dy,dz);
+ TPolyLine3D *axis = new TPolyLine3D(5,&(l[0][0]));
+ TPCON *arrow = new TPCON("arrow","","air",0.0,360.,2);
+ TRotMatrix *xarrow= new TRotMatrix("xarrow","",90.,0.0,0.0);
+ TRotMatrix *yarrow= new TRotMatrix("yarrow","",0.0,90.,0.0);
+ det->SetLineColor(0); // black
+ det->SetLineStyle(1); // solid line
+ det->SetLineWidth(2); // pixel units
+ det->SetFillColor(1); // black
+ det->SetFillStyle(4010); // window is 90% transparent
+ arrow->SetLineColor(det->GetLineColor());
+ arrow->SetLineWidth(det->GetLineWidth());
+ arrow->SetLineStyle(det->GetLineStyle());
+ arrow->SetFillColor(1); // black
+ arrow->SetFillStyle(4100); // window is 100% opaque
+ arrow->DefineSection(0,0.0,0.0,rmax);
+ arrow->DefineSection(1,2.*rmax,0.0,0.0);
+ view->SetRange(-dx0,-dy0,-dz0,dx0,dy0,dz0);
+ //
+ TNode *node0 = new TNode("NODE0","NODE0",mother);
+ node0->cd();
+ TNode *node1 = new TNode("NODE1","NODE1",det);
+ node1->cd();
+ TNode *nodex = new TNode("NODEx","NODEx",arrow,l[0][0],l[0][1],l[0][2],xarrow);
+ TNode *nodey = new TNode("NODEy","NODEy",arrow,l[2][0],l[2][1],l[2][2],yarrow);
+ TNode *nodez = new TNode("NODEz","NODEz",arrow,l[4][0],l[4][1],l[4][2]);
+ //
+ axis->Draw();
+ nodex->Draw();
+ nodey->Draw();
+ nodez->Draw();
+
+ //
+ node0->cd();
+ node0->Draw();
+ c->Update();
+ c->SaveAs("AliITSgeomMatrix_L1.gif");
+}
//----------------------------------------------------------------------
ostream &operator<<(ostream &os,AliITSgeomMatrix &p){
-////////////////////////////////////////////////////////////////////////
-// Standard output streaming function.
-////////////////////////////////////////////////////////////////////////
+ // Standard output streaming function.
+ // Inputs:
+ // ostream &os The output stream to print the class data on
+ // AliITSgeomMatrix &p This class
+ // Outputs:
+ // none.
+ // Return:
+ // none.
p.Print(&os);
return os;
}
//----------------------------------------------------------------------
istream &operator>>(istream &is,AliITSgeomMatrix &r){
-////////////////////////////////////////////////////////////////////////
-// Standard input streaming function.
-////////////////////////////////////////////////////////////////////////
+ // Standard input streaming function.
+ // Inputs:
+ // ostream &os The input stream to print the class data on
+ // AliITSgeomMatrix &p This class
+ // Outputs:
+ // none.
+ // Return:
+ // none.
r.Read(&is);
return is;
#define ALIITSGEOMMATRIX_H
/* Copyright(c) 2000, ALICE Experiment at CERN, All rights reserved. *
* see cxx source for full Copyright notice. */
-/* $Id: */
-////////////////////////////////////////////////////////////////////////
-// ITS geometry manipulation routines on the module level. This class is
-// to replace the structure ITS_geom in the class AliITSgeom.
-// Created May 30 2000.
-// version 0.0.0
-// By Bjorn S. Nilsen
-////////////////////////////////////////////////////////////////////////
-
+/*
+$Id:
+*/
+/*
+ ITS geometry manipulation routines on the module level. This class is
+ to replace the structure ITS_geom in the class AliITSgeom.
+ Created May 30 2000.
+ version 0.0.0
+ By Bjorn S. Nilsen
+*/
#include <TObject.h>
+#include <TString.h>
+class TPolyLine3D;
+class TNode;
+class TShape;
class AliITSgeomMatrix : public TObject {
public:
void PrintTitles(ostream *os) const;
// Reads in the content of this class in the format of Print
void Read(istream *is);
- virtual void Print(Option_t *option="") const {TObject::Print(option);}
- virtual Int_t Read(const char *name) {return TObject::Read(name);}
+ virtual void Print(Option_t *option="") const {
+ TObject::Print(option);}
+ virtual Int_t Read(const char *name) {return TObject::Read(name);}
+ // Returns the geometry path corresponding to this transformation
+ TString& GetPath(){return fPath;}
+ // Sets the geometry path
+ void SetPath(const Char_t *p){fPath = p;}
+ void SetPath(const TString &p){fPath = p;}
// Given the rotation angles [radians] it fills frot and computes
// the rotation matrix fm.
void SetAngles(const Double_t rot[3]){// [radians]
// Sets the translation vector and computes fCylR and fCylPhi.
void SetTranslation(const Double_t tran[3]);
// sets the rotation matrix and computes the rotation angles [radians]
- void SetMatrix(Double_t matrix[3][3]){ for(Int_t i=0;i<3;i++)
+ void SetMatrix(const Double_t matrix[3][3]){ for(Int_t i=0;i<3;i++)
for(Int_t j=0;j<3;j++) fm[i][j]=matrix[i][j];this->AngleFromMatrix();}
// Sets the detector index value
void SetDetectorIndex(Int_t idt) {fDetectorIndex = idt;}
// given a position error matrix in ALICE Cartesian global
// coordinates [cm] returns a position error matrix in detector/
// module local Cartesian local coordinates [cm]
- void GtoLPositionError(Double_t g[3][3],Double_t l[3][3]) const;
+ void GtoLPositionError(const Double_t g[3][3],Double_t l[3][3]) const;
// given a position error matrix in detector/module Cartesian local
// coordinates [cm] returns a position error matrix in ALICE
// Cartesian global coordinates [cm]
- void LtoGPositionError(Double_t l[3][3],Double_t g[3][3]) const;
+ void LtoGPositionError(const Double_t l[3][3],Double_t g[3][3]) const;
// Tracking Related Routines
void GtoLPositionTracking(const Double_t g[3],Double_t l[3]) const;
// Given a position in Cartesian Tracking global coordinates [cm]
// given a position error matrix in Tracking Cartesian global
// coordinates [cm] returns a position error matrix in detector/
// module local Cartesian local coordinates [cm]
- void GtoLPositionErrorTracking(Double_t g[3][3],
+ void GtoLPositionErrorTracking(const Double_t g[3][3],
Double_t l[3][3]) const;
// given a position error matrix in detector/module Cartesian local
// coordinates [cm] returns a position error matrix in Tracking
// Cartesian global coordinates [cm]
- void LtoGPositionErrorTracking(Double_t l[3][3],
+ void LtoGPositionErrorTracking(const Double_t l[3][3],
Double_t g[3][3]) const;
// Computes the distance squared [cm^2] between a point t[3] and
// this module/detector
Double_t Distance2(const Double_t t[3]) const {Double_t d=0.0,q;
for(Int_t i=0;i<3;i++){q = t[i]-ftran[i]; d += q*q;}
return d;}
+ //
+ // Documentation related Class
+ TPolyLine3D* CreateLocalAxis();
+ TPolyLine3D* CreateLocalAxisTracking();
+ TNode* CreateNode(const Char_t *nodeName,const Char_t *nodeTitle,
+ TNode *mother,TShape *shape,Bool_t axis=kTRUE);
+ void MakeFigures();
+ //
private: // private functions
// Given the rotation matrix fm it fills the rotation angles frot
void MatrixFromAngle();
Double_t ftran[3]; // Translation vector of module x,y,z.
Double_t fCylR,fCylPhi; //! Translation vector in Cylindrical coord.
Double_t fm[3][3]; // Rotation matrix based on frot.
+ TString fPath; // Path within Geometry to this volume
// Note, fCylR and fCylPhi are added as data members because it costs
// about a factor of 10 to compute them over looking them up. Since
// they are used in some tracking algorithms this can be a large cost
// in computing time. They are not written out but computed.
- ClassDef(AliITSgeomMatrix,1) // Matrix class used by AliITSgeom.
+ ClassDef(AliITSgeomMatrix,2) // Matrix class used by AliITSgeom.
};
// Input and output function for standard C++ input/output.
ostream &operator<<(ostream &os,AliITSgeomMatrix &source);
#include "AliITSgeomSDD.h"
ClassImp(AliITSgeomSDD)
-AliITSgeomSDD::AliITSgeomSDD(){
+AliITSgeomSDD::AliITSgeomSDD():
+TObject(),
+fPeriod(0.0),
+fDvelocity(0.0),
+fNAnodesL(0),
+fNAnodesR(0),
+fAnodeXL(0.0),
+fAnodeXR(0.0),
+fAnodeLowEdgeL(0),
+fAnodeLowEdgeR(0),
+fName(),
+fTitle(),
+fMat(),
+fDx(0.0),
+fDy(0.0),
+fDz(0.0){
////////////////////////////////////////////////////////////////////////
// default constructor
////////////////////////////////////////////////////////////////////////
// const Float_t kDy = 0.014;//cm. (Geant 3.12 units) Radialy from the Beam
// const Float_t kDz = 3.763;//cm. (Geant 3.12 units) Allong the Beam Pipe
-// cout << "AliITSgeomSDD default creator called: start" << endl;
fPeriod = 0.0;
fDvelocity = 0.0;
fNAnodesL = 0;
fAnodeXR = 0.0;
fAnodeLowEdgeL = 0;
fAnodeLowEdgeR = 0;
- fShapeSDD = 0;
-// cout << "AliITSgeomSDD default creator called: end" << endl;
}
//________________________________________________________________________
AliITSgeomSDD::AliITSgeomSDD(const Float_t *box,Float_t per,Float_t vel,
Float_t axL,Float_t axR,
Int_t nAL,Float_t *leL,
- Int_t nAR,Float_t *leR){
+ Int_t nAR,Float_t *leR):
+TObject(),
+fPeriod(0.0),
+fDvelocity(0.0),
+fNAnodesL(0),
+fNAnodesR(0),
+fAnodeXL(0.0),
+fAnodeXR(0.0),
+fAnodeLowEdgeL(0),
+fAnodeLowEdgeR(0),
+fName(),
+fTitle(),
+fMat(),
+fDx(0.0),
+fDy(0.0),
+fDz(0.0){
////////////////////////////////////////////////////////////////////////
// Standard constructor
////////////////////////////////////////////////////////////////////////
fAnodeXR = 0.0;
fAnodeLowEdgeL = 0;
fAnodeLowEdgeR = 0;
- fShapeSDD = 0;
ResetSDD(box,per,vel,axL,axR,nAL,leL,nAR,leR);
}
//________________________________________________________________________
fNAnodesR = nAR;
fAnodeXL = axL;
fAnodeXR = axR;
-// if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL;
+ if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL;
fAnodeLowEdgeL = new Float_t[fNAnodesL];
-// if(fAnodeLowEdgeR!=0) delete fAnodeLowEdgeR;
+ if(fAnodeLowEdgeR!=0) delete fAnodeLowEdgeR;
fAnodeLowEdgeR = new Float_t[fNAnodesR];
for(i=0;i<fNAnodesL;i++) fAnodeLowEdgeL[i] = leL[i];
for(i=0;i<fNAnodesR;i++) fAnodeLowEdgeR[i] = leR[i];
- fShapeSDD = new TBRIK("ActiveSDD","Active volume of SDD","SDD SI DET",
- box[0],box[1],box[2]);
+ fName="ActiveSDD";
+ fTitle="Active volume of SDD";
+ fMat="SDD Si Det";
+ fDx=box[0];
+ fDy=box[1];
+ fDz=box[2];
}
//________________________________________________________________________
AliITSgeomSDD::~AliITSgeomSDD(){
// Destructor
- if(fShapeSDD!=0) delete fShapeSDD;
if(fAnodeLowEdgeL!=0) delete [] fAnodeLowEdgeL;
if(fAnodeLowEdgeR!=0) delete [] fAnodeLowEdgeR;
- fShapeSDD = 0;
fPeriod = 0.0;
fDvelocity = 0.0;
fAnodeXL = 0.0;
Int_t i;
if(this==&source) return;
- this->fShapeSDD = new TBRIK(*(source.fShapeSDD));
+ fName=source.fName;
+ fTitle=source.fTitle;
+ fMat=source.fMat;
+ fDx=source.fDx;
+ fDy=source.fDy;
+ fDz=source.fDz;
this->fPeriod = source.fPeriod;
this->fDvelocity = source.fDvelocity;
this->fNAnodesL = source.fNAnodesL;
Int_t i;
if(this==&source) return *this;
- this->fShapeSDD = new TBRIK(*(source.fShapeSDD));
+ fName=source.fName;
+ fTitle=source.fTitle;
+ fMat=source.fMat;
+ fDx=source.fDx;
+ fDy=source.fDy;
+ fDz=source.fDz;
this->fPeriod = source.fPeriod;
this->fDvelocity = source.fDvelocity;
this->fNAnodesL = source.fNAnodesL;
// Standard input format for this class.
////////////////////////////////////////////////////////////////////////
Int_t i;
- Float_t dx,dy,dz;
char shp[20];
*is >> shp;
- *is >> dx >> dy >> dz;
- if(fShapeSDD!=0) delete fShapeSDD;
- fShapeSDD = new TBRIK("ActiveSDD","Active volume of SDD","SDD SI DET",
- dx,dy,dz);
+ *is >> fDx >> fDy >> fDz;
+ fName="AcrtiveSDD";
+ fTitle="Active volulme of SDD";
+ fMat="SDD Si Det";
*is >> fPeriod >> fDvelocity >> fNAnodesL >> fNAnodesR;
*is >> fAnodeXL >> fAnodeXR;
if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL;
npar);
return;
} // end if
-// cout << "AliITSgeomSDD256 default creator called: start" << end;
anodeLowEdges[0] = kAnodesZ;
for(i=0;i<kNAnodes;i++)anodeLowEdges[i+1] = kAnodePitch+anodeLowEdges[i];
AliITSgeomSDD::ResetSDD(par,kPeriod,kVelocity,kAnodeXL,kAnodeXR,
kNAnodes+1,anodeLowEdges,
kNAnodes+1,anodeLowEdges);
-// cout << "AliITSgeomSDD256 default creator called: end" << endl;
}
//________________________________________________________________________
ostream &operator<<(ostream &os,AliITSgeomSDD256 &p){
const Float_t kanode = 0.0250;// cm anode separation.
Int_t i;
-// cout << "AliITSgeomSDD300 default creator called: start" << endl;
- anodeLowEdges[0] = kAnodesZ;
+ anodeLowEdges[0] = kAnodesZ;
for(i=0;i<kNAnodes;i++)anodeLowEdges[i+1] = kanode+anodeLowEdges[i];
AliITSgeomSDD::ResetSDD(kDxyz,kPeriod,kVelocity,kAnodeXL,kAnodeXR,
kNAnodes+1,anodeLowEdges,
kNAnodes+1,anodeLowEdges);
-// cout << "AliITSgeomSDD300 default creator called: end" << endl;
}
//________________________________________________________________________
ostream &operator<<(ostream &os,AliITSgeomSDD300 &p){
void ResetSDD(const Float_t *box,Float_t per,Float_t vel,
Float_t axL,Float_t axR,
Int_t nA0,Float_t *le0,Int_t nA1,Float_t *le1);
- virtual TShape *GetShape() const {return fShapeSDD;}
- virtual Float_t GetDx() const { // Get TBRIK Dx
- if(fShapeSDD!=0) return fShapeSDD->GetDx();
- else return 0.0;}
- virtual Float_t GetDy() const {// Get TBRIK Dy
- if(fShapeSDD!=0) return fShapeSDD->GetDy();
- else return 0.0;}
- virtual Float_t GetDz() const {// Get TBRIK Dz
- if(fShapeSDD!=0) return fShapeSDD->GetDz();
- else return 0.0;}
+ virtual TShape *GetShape() const {return new TBRIK(fName.Data(),
+ fTitle.Data(),fMat.Data(),GetDx(),GetDy(),GetDz());}
+ virtual Float_t GetDx() const {return fDx;} // Get TBRIK Dx
+ virtual Float_t GetDy() const {return fDy;}// Get TBRIK Dy
+ virtual Float_t GetDz() const {return fDz;}// Get TBRIK Dz
virtual Float_t GetAnodeX(Int_t a,Int_t s) const {
// returns X position of anode
a = 0; if(s==0) return fAnodeXL; else return fAnodeXR;}
virtual void SetDriftVelocity(Float_t s)
{fDvelocity = s;} // sets the SDD Drift velocity cm/s.
virtual void SetShape(char *name,char *title,char *mat,
- Float_t dx,Float_t dy,Float_t dz)
- {fShapeSDD = new TBRIK(name,title,mat,dx,dy,dz);}
+ Float_t dx,Float_t dy,Float_t dz){fName=name;
+ fTitle=title;fMat=mat;fDx=dx;fDy=dy;fDz=dz;}
virtual void Local2Det(Float_t xl,Float_t zl,Int_t &a,Int_t &t,Int_t &s);
virtual void Det2Local(Int_t a,Int_t t,Int_t s,Float_t &xl,Float_t &zl);
virtual void Print(ostream *os) const; // Output streamer to standard out.
Float_t fAnodeXR; // Anode location in x Right side
Float_t *fAnodeLowEdgeL; //[fNAnodesL] Anode spacing left edge
Float_t *fAnodeLowEdgeR; //[fNAnodesR] Anode spacing right edge
- TBRIK *fShapeSDD; // shape of sensitive volume
+ TString fName; // Object name
+ TString fTitle; // Ojbect title
+ TString fMat; // Object material name Replacement for TBRIK
+ Float_t fDx; // half length in z Replacement for TBRIK
+ Float_t fDy; // half length in y Replacement for TBRIK
+ Float_t fDz; // half length in z Replacement for TBRIK
- ClassDef(AliITSgeomSDD,1) // ITS SDD detector geometry class
+ ClassDef(AliITSgeomSDD,2) // ITS SDD detector geometry class
};
// Input and output function for standard C++ input/output.
//#include "AliITSgeomSDD.h"
-
class AliITSgeomSDD300 : public AliITSgeomSDD {
public:
////////////////////////////////////////////////////////////////////////
#include <Riostream.h>
+#include <TGeometry.h>
#include <TShape.h>
#include <TMath.h>
ClassImp(AliITSgeomSPD)
-AliITSgeomSPD::AliITSgeomSPD(){
+AliITSgeomSPD::AliITSgeomSPD():
+TObject(),
+fName(),
+fTitle(),
+fMat(),
+fDx(0.0),
+fDy(0.0),
+fDz(0.0),
+fNbinx(0),
+fNbinz(0),
+fLowBinEdgeX(0),
+fLowBinEdgeZ(0){
// Default Constructor. Set everthing to null.
-
- fShapeSPD = 0;
- fNbinx = 0;
- fNbinz = 0;
- fLowBinEdgeX = 0;
- fLowBinEdgeZ = 0;
}
//______________________________________________________________________
AliITSgeomSPD::AliITSgeomSPD(Float_t dy,Int_t nx,Float_t *bx,
- Int_t nz,Float_t *bz){
+ Int_t nz,Float_t *bz):
+TObject(),
+fName(),
+fTitle(),
+fMat(),
+fDx(0.0),
+fDy(0.0),
+fDz(0.0),
+fNbinx(0),
+fNbinz(0),
+fLowBinEdgeX(0),
+fLowBinEdgeZ(0){
// Standard Constructor. Set everthing to null.
- fShapeSPD = 0;
- fNbinx = 0;
- fNbinz = 0;
- fLowBinEdgeX = 0;
- fLowBinEdgeZ = 0;
ReSetBins(dy,nx,bx,nz,bz);
return;
}
dx *= 0.5;
dz *= 0.5;
- delete fShapeSPD; // delete existing shape
- if(this->fLowBinEdgeX) delete[] this->fLowBinEdgeX; // delete existing
- if(this->fLowBinEdgeZ) delete[] this->fLowBinEdgeZ; // delete existing
+ if(fLowBinEdgeX) delete[] fLowBinEdgeX; // delete existing
+ if(fLowBinEdgeZ) delete[] fLowBinEdgeZ; // delete existing
+ fLowBinEdgeX = 0;
+ fLowBinEdgeZ = 0;
SetNbinX(nx);
SetNbinZ(nz);
fLowBinEdgeZ[0] = -dz;
for(i=0;i<nx;i++) fLowBinEdgeX[i+1] = fLowBinEdgeX[i] + bx[i];
for(i=0;i<nz;i++) fLowBinEdgeZ[i+1] = fLowBinEdgeZ[i] + bz[i];
- SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,dy,dz);
+ SetShape("ActiveSPD","Active volume of SPD","",dx,dy,dz);
return;
}
//______________________________________________________________________
Int_t i;
if(&source == this) return *this;
- this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
- if(this->fLowBinEdgeX) delete[] this->fLowBinEdgeX;
- if(this->fLowBinEdgeZ) delete[] this->fLowBinEdgeZ;
+ fName=source.fName;
+ fTitle=source.fTitle;
+ fMat=source.fMat;
+ fDx=source.fDx;
+ fDy=source.fDy;
+ fDz=source.fDz;
+ if(this->fLowBinEdgeX) delete[] (this->fLowBinEdgeX);
+ if(this->fLowBinEdgeZ) delete[] (this->fLowBinEdgeZ);
this->fNbinx = source.fNbinx;
this->fNbinz = source.fNbinz;
this->InitLowBinEdgeX();
AliITSgeomSPD::~AliITSgeomSPD(){
// Destructor
- delete fShapeSPD;
- if(this->fLowBinEdgeX) delete[] this->fLowBinEdgeX;
- if(this->fLowBinEdgeZ) delete[] this->fLowBinEdgeZ;
- fShapeSPD = 0;
+ if(fLowBinEdgeX) delete[] fLowBinEdgeX;
+ if(fLowBinEdgeZ) delete[] fLowBinEdgeZ;
fNbinx = 0;
fNbinz = 0;
fLowBinEdgeX = 0;
fLowBinEdgeZ = 0;
}
//______________________________________________________________________
+void AliITSgeomSPD::SetShape(const char *name,const char *title,
+ const char *mat,Float_t dx,Float_t dy,Float_t dz){
+ // Delete any existing shape info and replace it with a new
+ // shape information.
+ // Inputs:
+ // char * name Name of the shape
+ // char * title Title of the shape
+ // char * mat Material name for the shape
+ // Float_t dx half width of the shape [cm]
+ // Float_t dy half thickness of the shape [cm]
+ // Float_t dz half length of the shape [cm]
+ // Outputs:
+ // none.
+ // Return:
+ // none.
+
+ fName = name;
+ fTitle = title;
+ fDx = dx;
+ fDy = dy;
+ fDz = dz;
+ return;
+}
+//______________________________________________________________________
void AliITSgeomSPD::LToDet(Float_t xl,Float_t zl,Int_t &row,Int_t &col){
// Returns the row and column pixel numbers for a given local coordinate
// system. If they are outside then it will return -1 or fNbinx/z.
*is >> shape;
if(strcmp(shape,"TBRIK")) Warning("::Read","Shape not a TBRIK");
*is >> dx >> dy >> dz;
- if(fShapeSPD!=0) delete fShapeSPD;
- SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,dy,dz);
+ SetShape("ActiveSPD","Active volume of SPD","",dx,dy,dz);
*is >> i >> j;
SetNbinX(i);
SetNbinZ(j);
Int_t i;
Float_t dx=0.0,dz=0.0;
-// cout << "AliITSgeomSPD300 default creator called: start" << endl;
-
SetNbinX(knbinx); // default number of bins in x.
SetNbinZ(knbinz); // default number of bins in z.
if(TMath::Abs(dx-kdx)>1.0E-4 || TMath::Abs(dz-kdz)>1.0E-4)
Warning("Default Creator","Detector size may not be write.");
- SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,kdy,dz);
-// cout << "AliITSgeomSPD300 default creator called: end" << endl;
+ SetShape("ActiveSPD","Active volume of SPD","",dx,kdy,dz);
}
//----------------------------------------------------------------------
ostream &operator<<(ostream &os,AliITSgeomSPD300 &p){
"npar=%d<3 array par must be at least [3] or larger",npar);
return;
} // end if
- SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",
+ SetShape("ActiveSPD","Active volume of SPD","",
par[0],par[1],par[2]);
if(TMath::Abs(dx-kdx)>1.0E-4 || TMath::Abs(dz-kdz)>1.0E-4)
Warning("Default Creator","Detector size may not be write.");
for(i=0;i<knbinz;i++) dz += binSizeZ[i];
dz *= 0.5;
- SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,kdy,dz);
+ SetShape("ActiveSPD","Active volume of SPD","",dx,kdy,dz);
if(TMath::Abs(dx-kdx)>1.0E-4 || TMath::Abs(dz-kdz)>1.0E-4)
Warning("Default Creator","Detector size may not be write.");
* See cxx source for full Copyright notice */
/* $Id$ */
-
+#include <Riostream.h>
#include <TObject.h>
#include <TBRIK.h>
virtual ~AliITSgeomSPD();
virtual void ReSetBins(Float_t dy,Int_t nx,Float_t *bx,
Int_t nz,Float_t *bz);
- virtual TShape *GetShape() const {return fShapeSPD;}
- virtual Float_t GetDx() const { // Get TBRIK Dx
- if(fShapeSPD!=0) return fShapeSPD->GetDx();
- else return 0.0;}
- virtual Float_t GetDy() const {// Get TBRIK Dy
- if(fShapeSPD!=0) return fShapeSPD->GetDy();
- else return 0.0;}
- virtual Float_t GetDz() const {// Get TBRIK Dz
- if(fShapeSPD!=0) return fShapeSPD->GetDz();
- else return 0.0;}
+ virtual TShape *GetShape() const {return new TBRIK(fName.Data(),
+ fTitle.Data(),fMat.Data(),GetDx(),GetDy(),GetDz());}
+ virtual Float_t GetDx() const {return fDx;} // Get TBRIK Dx
+ virtual Float_t GetDy() const {return fDy;}// Get TBRIK Dy
+ virtual Float_t GetDz() const {return fDz;}// Get TBRIK Dz
virtual Int_t GetNbinsX() const {return fNbinx-1;} // returns the number of bins x
virtual Int_t GetNbinsZ() const {return fNbinz-1;} // returns the number of bins z
virtual Float_t GetBinSizeX(Int_t i) const
if(fLowBinEdgeZ!=0) delete[] fLowBinEdgeZ;
if(fNbinz>0) fLowBinEdgeZ = new Float_t[fNbinz];else fLowBinEdgeZ = 0;}
virtual void SetShape(const char *name,const char *title,const char *mat,
- Float_t dx,Float_t dy,Float_t dz)
- {fShapeSPD = new TBRIK(name,title,mat,dx,dy,dz);};
+ Float_t dx,Float_t dy,Float_t dz);
virtual void SetNbinX(Int_t i){fNbinx = i+1;} // Set nubmer of pixels in x
virtual void SetNbinZ(Int_t i){fNbinz = i+1;} // Set nubmer of pixels in z
virtual void SetLowBinEdgeX(Int_t i,Float_t s){//puts value in fLowbinEdgeX
virtual Int_t Read(const char *name) {return TObject::Read(name);}
protected:
- TBRIK *fShapeSPD; // SPD active area shape
+ TString fName; // Object name Replacement for TBRIK
+ TString fTitle; // Ojbect title Replacement for TBRIK
+ TString fMat; // Object material name Replacement for TBRIK
+ Float_t fDx; // half length in z Replacement for TBRIK
+ Float_t fDy; // half length in y Replacement for TBRIK
+ Float_t fDz; // half length in z Replacement for TBRIK
Int_t fNbinx; // the number of elements in fLowBinEdgeX (#bins-1)
Int_t fNbinz; // the number of elements in fLowBinEdgeZ (#bins-1)
Float_t *fLowBinEdgeX; //[fNbinx] Array of X lower bin edges for the pixels
Float_t *fLowBinEdgeZ; //[fNbinz] Array of Z lower bin edges for the pixels
- ClassDef(AliITSgeomSPD,1) // ITS SPD detector geometry class..
+ ClassDef(AliITSgeomSPD,2) // ITS SPD detector geometry class..
};
// Input and output function for standard C++ input/output.
ClassImp(AliITSgeomSSD)
-AliITSgeomSSD::AliITSgeomSSD(){
+AliITSgeomSSD::AliITSgeomSSD():
+TObject(),
+fName(),
+fTitle(),
+fMat(),
+fDx(0.0),
+fDy(0.0),
+fDz(0.0),
+fNp(0),
+fNn(0),
+fLowEdgeP(0),
+fLowEdgeN(0),
+fAngleP(0.0),
+fAngleN(0.0){
// Default constructor
- fShapeSSD = 0;
fNp = 0;
fNn = 0;
fLowEdgeP = 0;
}
//----------------------------------------------------------------------
AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
- Int_t np,Float_t *p,Int_t nn,Float_t *n){
+ Int_t np,Float_t *p,Int_t nn,Float_t *n):
+TObject(),
+fName(),
+fTitle(),
+fMat(),
+fDx(0.0),
+fDy(0.0),
+fDz(0.0),
+fNp(0),
+fNn(0),
+fLowEdgeP(0),
+fLowEdgeN(0),
+fAngleP(0.0),
+fAngleN(0.0){
////////////////////////////////////////////////////////////////////////
// Standard Constructor. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
// nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
// np= number of anodes+1, *p= array of anode low edges+lighest edge.
///////////////////////////////////////////////////////////////////////
- fShapeSSD = 0;
fNp = 0;
fNn = 0;
fLowEdgeP = 0;
///////////////////////////////////////////////////////////////////////
Int_t i;
- fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
- box[0],box[1],box[2]);
-// if(fLowEdgeP!=0) delete fLowEdgeP;
-// if(fLowEdgeN!=0) delete fLowEdgeN;
+ fName = "ActiveSSD";
+ fTitle = "Active volume of SSD";
+ fMat = "SSD Si Det";
+ fDx = box[0];
+ fDy = box[1];
+ fDz = box[2];
+ if(fLowEdgeP!=0) delete fLowEdgeP;
+ if(fLowEdgeN!=0) delete fLowEdgeN;
fNp = np;
fNn = nn;
fAngleP = ap;
if(fLowEdgeP) delete [] fLowEdgeP; fLowEdgeP = 0;
if(fLowEdgeN) delete [] fLowEdgeN; fLowEdgeN = 0;
- if(fShapeSSD) delete fShapeSSD; fShapeSSD = 0;
fNp = 0;
fNn = 0;
fAngleP = 0.0;
Int_t i;
if(this == &source) return;
- this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
+ fName = source.fName;
+ fTitle = source.fTitle;
+ fMat = source.fMat;
+ fDx = source.fDx;
+ fDy = source.fDy;
+ fDz = source.fDz;
this->fNp = source.fNp;
this->fNn = source.fNn;
delete fLowEdgeP;
Int_t i;
if(this == &source) return *this;
- this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
+ fName = source.fName;
+ fTitle = source.fTitle;
+ fMat = source.fMat;
+ fDx = source.fDx;
+ fDy = source.fDy;
+ fDz = source.fDz;
this->fNp = source.fNp;
this->fNn = source.fNn;
delete fLowEdgeP;
////////////////////////////////////////////////////////////////////////
// Standard input format for this class.
////////////////////////////////////////////////////////////////////////
- Float_t dx,dy,dz;
Int_t i;
char shp[20];
*is >> shp;
- *is >> dx >> dy >> dz;
- if(fShapeSSD!=0) delete fShapeSSD;
- fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
- dx,dy,dz);
+ *is >> fDx >> fDy >> fDz;
*is >> fNp >> fNn;
*is >> fAngleP >> fAngleN;
if(fLowEdgeP !=0) delete fLowEdgeP;
} // end for i
leA[kNstrips] = kDxyz[0];
leC[kNstrips] = -kDxyz[0];
-// cout << "AliITSgeomSSD175 default creator called: start" << endl;
AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
kNstrips+1,leA,kNstrips+1,leC);
delete leA;
delete leC;
-// cout << "AliITSgeomSSD175 default creator called: end" << endl;
}
//________________________________________________________________________
ostream &operator<<(ostream &os,AliITSgeomSSD175 &p){
} // end for i
leA[kNstrips] = kDxyz[0];
leC[kNstrips] = -kDxyz[0];
-// cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
kNstrips+1,leA,kNstrips+1,leC);
delete [] leA;
delete [] leC;
-// cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
}
//________________________________________________________________________
ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
} // end for i
leA[kNstrips] = kDxyz[0];
leC[kNstrips] = -kDxyz[0];
-// cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
kNstrips+1,leA,kNstrips+1,leC);
delete leA;
delete leC;
-// cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
}
//________________________________________________________________________
ostream &operator<<(ostream &os,AliITSgeomSSD75and275 &p){
virtual AliITSgeomSSD& operator=(const AliITSgeomSSD &source); // = opt.
void ResetSSD(const Float_t *box,Float_t ap,Float_t an,
Int_t np,Float_t *p,Int_t nn,Float_t *n); // Filler
- virtual TShape *GetShape() const {return fShapeSSD;}// get shape
- virtual Float_t GetDx() const {if(fShapeSSD!=0) return fShapeSSD->GetDx();
- else return 0.0;}// get Dx
- virtual Float_t GetDy() const {if(fShapeSSD!=0) return fShapeSSD->GetDy();
- else return 0.0;}// get Dy
- virtual Float_t GetDz() const {if(fShapeSSD!=0) return fShapeSSD->GetDz();
- else return 0.0;}// get Dz
+ virtual TShape *GetShape() const {return new TBRIK(fName.Data(),
+ fTitle.Data(),fMat.Data(),GetDx(),GetDy(),GetDz());}// get shape
+ virtual Float_t GetDx() const {return fDx;}// get Dx
+ virtual Float_t GetDy() const {return fDy;}// get Dy
+ virtual Float_t GetDz() const {return fDz;}// get Dz
virtual Int_t GetNAnodes() const {return fNp-1;}//the number of Anodes "P"
virtual Int_t GetNCathodess() const {return fNn-1;}//the number of Cathodes "N"
virtual Float_t GetAnodePitch(Int_t i=0) const { //anode pitch for anode i
virtual void SetShape(char *name,char *title,char *mat,
Float_t dx,Float_t dy,Float_t dz){
// defines TBRIK with given paramters
- fShapeSSD = new TBRIK(name,title,mat,dx,dy,dz);};
+ fName = name;fTitle = title;fMat = mat; fDx=dx;fDy=dy;fDz=dz;};
virtual void SetNAnodes(Int_t n) {// sets the number of Anodes "P" and
// allocates array of low edges.
fNp=n+1;delete fLowEdgeP;fLowEdgeP = new Float_t[fNp];}
// |
// V
// z
- TBRIK *fShapeSSD; // comment
+ TString fName; // Object name Replacement for TBRIK
+ TString fTitle; // Ojbect title Replacement for TBRIK
+ TString fMat; // Object material name Replacement for TBRIK
+ Float_t fDx; // half length in z Replacement for TBRIK
+ Float_t fDy; // half length in y Replacement for TBRIK
+ Float_t fDz; // half length in z Replacement for TBRIK
Int_t fNp; // Number of Anode strips.
Int_t fNn; // Number of Cathode strips.
Float_t *fLowEdgeP; //[fNp] Anode side strip pitch angle==0.
Float_t fAngleN; // Cathode side strip angle (rad).
// or what other or different information that is needed.
- ClassDef(AliITSgeomSSD,1) // ITS SSD detector geometry class
+ ClassDef(AliITSgeomSSD,2) // ITS SSD detector geometry class
};
// Input and output function for standard C++ input/output.
// Set Detector Segmentation Parameters
//
-
+ // get the drift speed used for this segmentation
+ virtual Float_t GetDriftSpeed()const{return fDriftSpeed;}
+ // Set the drift speed needed for this segmentation
+ virtual void SetDriftSpeed(Float_t ds){fDriftSpeed = ds;}
// Cell size dz*dx
virtual void SetPadSize(Float_t pitch, Float_t clock)
{fPitch=pitch;fTimeStep=1000./clock;}
gMC->GetShape(path.Data(),shapeName,shapePar);
shapeParF.Set(shapePar.GetSize());
for(i=0;i<shapePar.GetSize();i++) shapeParF[i]=shapePar[i];
- geom->CreatMatrix(mod,lay,lad,det,idet[lay-1],trans,rot);
+ geom->CreateMatrix(mod,lay,lad,det,idet[lay-1],trans,rot);
geom->SetTrans(mod,materix.GetTranslation());
geom->SetRotMatrix(mod,materix.GetRotationMatrix());
switch (lay){
r[3],r[4],r[5],
r[6],r[7],r[8], 1.0};
//rot[9]!=0.0 => not a unity matrix
- geom->CreatMatrix(startMod,iLay+iLaySDD,iLadd+1,iDet+1,
+ geom->CreateMatrix(startMod,iLay+iLaySDD,iLadd+1,iDet+1,
kSDD,trans,rot);
// iLadd+1, iDet+1 because ladd. and det. start at +1
// elsewhere
Int_t iLad = 1;
Int_t iLay = 1;
if (i+1>2) iLay = 2;
- GetITSgeom()->CreatMatrix(startMod,iLay,iLad,iDet,kSPD,trans,rot);
+ GetITSgeom()->CreateMatrix(startMod,iLay,iLad,iDet,kSPD,trans,rot);
startMod++;
};
};
Int_t iDet = 1;
Int_t iLad = 1;
Int_t iLay = fNspd-1+i;
- GetITSgeom()->CreatMatrix(startMod,iLay,iLad,iDet,kSDD,trans,rot);
+ GetITSgeom()->CreateMatrix(startMod,iLay,iLad,iDet,kSDD,trans,rot);
startMod++;
};
};
Int_t iLad = 1;
Int_t iLay = 5;
if (i+1>2) iLay = 6;
- GetITSgeom()->CreatMatrix(startMod,iLay,iLad,iDet,kSSD,trans,rot);
+ GetITSgeom()->CreateMatrix(startMod,iLay,iLad,iDet,kSSD,trans,rot);
startMod++;
};
};
AliITSCalibration *resp0=new AliITSCalibrationSPD();
SetCalibrationModel(kSPD,resp0);
- AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(GetITSgeom());
+ AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD();
seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
s0->GetDz()*2.*kconv, // for now.
s0->GetDy()*2.*kconv);// x,z,y full width in microns.
if (s1) {
AliITSCalibrationSDD *resp1=new AliITSCalibrationSDD("simulated");
SetCalibrationModel(kSDD,resp1);
- AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(GetITSgeom(),resp1);
+ AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD();
seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
s1->GetDz()*4.*kconv, // for now.
s1->GetDy()*4.*kconv); // x,z,y full width in microns.
+ seg1->SetDriftSpeed(resp1->GetDriftSpeed());
seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
SetSegmentationModel(kSDD,seg1);
const char *kData1=(fDetTypeSim->GetCalibrationModel(kSDD))->DataType();
AliITSCalibration *resp2=new AliITSCalibrationSSD("simulated");
SetCalibrationModel(kSSD,resp2);
- AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(GetITSgeom());
+ AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD();
seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD
s2->GetDz()*2.*kconv, // for now.
s2->GetDy()*2.*kconv); // x,z,y full width in microns.
// Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
// AliITSvPPRasymmFMD.
// In general it is automatically replaced by
- // the CreatMaterials routine defined in AliITSv?. Should the function
+ // the CreateMaterials routine defined in AliITSv?. Should the function
// CreateMaterials not exist for the geometry version you are using this
// one is used. See the definition found in AliITSv5 or the other routine
// for a complete definition.
Float_t wAlOxide[2] = {0.4707, 0.5293};
Float_t dAlOxide = 3.97;
-
AliMaterial(1,"SI$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
AliMedium(1,"SI$",1,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
Double_t trans[3]={3*0.0},rot[10]={9*0.0,1.0};
TArrayD shapePar;
TArrayF shapeParF;
+ Bool_t shapeDefined[3]={kFALSE,kFALSE,kFALSE};
AliDebug(1,"Reading Geometry transformation directly from Modler.");
mod = 0;
mod += k;
} // end for i
- if(GetITSgeom()!=0) delete GetITSgeom();
SetITSgeom(0);
nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
ndet[0]= 4;ndet[1]= 4;ndet[2]= 6;ndet[3]= 8;ndet[4]=22;ndet[5]=25;
gMC->GetShape(path.Data(),shapeName,shapePar);
shapeParF.Set(shapePar.GetSize());
for(i=0;i<shapePar.GetSize();i++) shapeParF[i]=shapePar[i];
- geom->CreatMatrix(mod,lay,lad,det,idet[lay-1],trans,rot);
+ geom->CreateMatrix(mod,lay,lad,det,idet[lay-1],trans,rot);
geom->SetTrans(mod,materix.GetTranslation());
geom->SetRotMatrix(mod,materix.GetRotationMatrix());
switch (lay){
- case 1: case 2:{
+ case 1: case 2:
+ if(!shapeDefined[kSPD]){
geom->ReSetShape(kSPD,new AliITSgeomSPD425Short(
shapeParF.GetSize(),shapeParF.GetArray()));
+ shapeDefined[kSPD] = kTRUE;
}break;
- case 3: case 4:{
+ case 3: case 4:
+ if(!shapeDefined[kSDD]){
geom->ReSetShape(kSDD,new AliITSgeomSDD256(
shapeParF.GetSize(),shapeParF.GetArray()));
+ shapeDefined[kSDD] = kTRUE;
}break;
- case 5: case 6:{
+ case 5: case 6:
+ if(!shapeDefined[kSSD]){
geom->ReSetShape(kSSD,new AliITSgeomSSD75and275(
shapeParF.GetSize(),shapeParF.GetArray()));
+ shapeDefined[kSSD] = kTRUE;
}break;
default:{
}break;
// Return:
// none.
- AliInfo(Form("Minor version %d",fMinorVersion));
+ AliInfo(Form("Init: Major version %d Minor version %d",fMajorVersion,
+ fMinorVersion));
//
if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
- if(GetITSgeom()!=0) SetITSgeom(0x0);
AliITSgeom* geom = new AliITSgeom();
SetITSgeom(geom);
if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead);
// none.
const Float_t kconv = 1.0e+04; // convert cm to microns
- AliInfo("Called");
- if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
- fDetTypeSim->SetITSgeom(GetITSgeom());
-
+ if(!fDetTypeSim){
+ Warning("SetDefaults","Error fDetTypeSim not defined");
+ return;
+ }
+
AliITSgeomSPD *s0;
AliITSgeomSDD *s1;
AliITSgeomSSD *s2;
Int_t i;
Float_t bx[256],bz[280];
-
-
+
fDetTypeSim->SetDefaults();
//SPD
- s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);// Get shape info. Do it this way for now.
+ s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);
+ // Get shape info. Do it this way for now.
//AliITSCalibrationSPD* resp0=new AliITSCalibrationSPD();
-
- //AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(GetITSgeom());
-
- AliITSsegmentationSPD* seg0 = (AliITSsegmentationSPD*)fDetTypeSim->GetSegmentationModel(0);
+ AliITSsegmentationSPD* seg0 =
+ (AliITSsegmentationSPD*)fDetTypeSim->GetSegmentationModel(0);
seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
s0->GetDz()*2.*kconv, // for now.
s0->GetDy()*2.*kconv); // x,z,y full width in microns.
seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
SetSegmentationModel(kSPD,seg0);
// set digit and raw cluster classes to be used
- const char *kData0=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSPD()))->DataType();
- if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit");
+ const char *kData0=(fDetTypeSim->GetCalibrationModel(
+ GetITSgeom()->GetStartSPD()))->DataType();
+ if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,
+ "AliITSdigit");
else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
// SDD
- s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info. Do it this way for now.
+ s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);
+ // Get shape info. Do it this way for now.
//AliITSCalibrationSDD* resp1=new AliITSCalibrationSDD("simulated");
-
- //AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(GetITSgeom(),resp1);
-
- AliITSsegmentationSDD* seg1 = (AliITSsegmentationSDD*)fDetTypeSim->GetSegmentationModel(1);
+ AliITSsegmentationSDD* seg1 =
+ (AliITSsegmentationSDD*)fDetTypeSim->GetSegmentationModel(1);
seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
s1->GetDz()*2.*kconv, // for now.
s1->GetDy()*2.*kconv); // x,z,y full width in microns.
seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
SetSegmentationModel(kSDD,seg1);
- const char *kData1=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD()))->DataType();
- AliITSCalibrationSDD* rsp = (AliITSCalibrationSDD*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD());
+ const char *kData1=(fDetTypeSim->GetCalibrationModel(
+ GetITSgeom()->GetStartSDD()))->DataType();
+ AliITSCalibrationSDD* rsp =
+ (AliITSCalibrationSDD*)fDetTypeSim->GetCalibrationModel(
+ GetITSgeom()->GetStartSDD());
const char *kopt=rsp->GetZeroSuppOption();
if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){
fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit");
} else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
// SSD Layer 5
- s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now.
+ s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);
+ // Get shape info. Do it this way for now.
- //SetCalibrationModel(GetITSgeom()->GetStartSSD(),new AliITSCalibrationSSD("simulated"));
-
- //AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(GetITSgeom());
- AliITSsegmentationSSD* seg2 = (AliITSsegmentationSSD*)fDetTypeSim->GetSegmentationModel(2);
+ //SetCalibrationModel(GetITSgeom()->GetStartSSD(),
+ // new AliITSCalibrationSSD("simulated"));
+ AliITSsegmentationSSD* seg2 =
+ (AliITSsegmentationSSD*)fDetTypeSim->GetSegmentationModel(2);
seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD
s2->GetDz()*2.*kconv, // for now.
s2->GetDy()*2.*kconv); // x,z,y full width in microns.
seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
SetSegmentationModel(kSSD,seg2);
- const char *kData2=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()))->DataType();
- if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
+ const char *kData2=(fDetTypeSim->GetCalibrationModel(
+ GetITSgeom()->GetStartSSD()))->DataType();
+ if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,
+ "AliITSdigit");
else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
if(fgkNTYPES>3){
Warning("SetDefaults",
"Only the four basic detector types are initialised!");
}// end if
-
-
return;
}
//______________________________________________________________________
// Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
// AliITSvPPRcoarseasymm.
// In general it is automatically replaced by
- // the CreatMaterials routine defined in AliITSv?. Should the function
+ // the CreateMaterials routine defined in AliITSv?. Should the function
// CreateMaterials not exist for the geometry version you are using this
// one is used. See the definition found in AliITSv5 or the other routine
// for a complete definition.
// Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
// AliITSvSDD03.
// In general it is automatically replaced by
- // the CreatMaterials routine defined in AliITSv?. Should the function
+ // the CreateMaterials routine defined in AliITSv?. Should the function
// CreateMaterials not exist for the geometry version you are using this
// one is used. See the definition found in AliITSv5 or the other routine
// for a complete definition.
switch (typ){
case 2:
- GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
+ GetITSgeom()->CreateMatrix(mod,lay,lad,det,kSDD,t,r);
if(!(GetITSgeom()->IsShapeDefined((Int_t)kSDD))){
GetITSgeom()->ReSetShape(kSDD,new AliITSgeomSDD256(npar,par));
} // end if
break;
case 1:
- GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
+ GetITSgeom()->CreateMatrix(mod,lay,lad,det,kSSD,t,r);
if(!(GetITSgeom()->IsShapeDefined((Int_t)kSSD))){
GetITSgeom()->ReSetShape(kSSD,new AliITSgeomSSD(box,0.0,0.0,
knp+1,p,knp+1,n));
// Return:
// none.
- const Float_t kconv = 1.0e+04; // convert cm to microns
+ // const Float_t kconv = 1.0e+04; // convert cm to microns
if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
fDetTypeSim->SetITSgeom(GetITSgeom());
AliITSgeomSDD *s1;
AliITSgeomSSD *s2;
SetCalibrationModel(GetITSgeom()->GetStartSPD(),new AliITSCalibrationSPD());
- SetSegmentationModel(kSPD,new AliITSsegmentationSPD());
+ SetSegmentationModel(kSPD,(AliITSsegmentationSPD*)
+ (GetITSgeom()->GetShape(kSPD)));
fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
// SDD
AliITSCalibrationSDD *resp1=new AliITSCalibrationSDD("simulated");
SetCalibrationModel(GetITSgeom()->GetStartSDD(),resp1);
- AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(GetITSgeom(),resp1);
- seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
- s1->GetDz()*2.*kconv, // for now.
- s1->GetDy()*2.*kconv); // x,z,y full width in microns.
-
+ AliITSsegmentationSDD *seg1 = (AliITSsegmentationSDD*)
+ (GetITSgeom()->GetShape(kSDD));
+ seg1->SetDriftSpeed(resp1->GetDriftSpeed());
seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
SetSegmentationModel(kSDD,seg1);
const char *kData1=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD()))->DataType();
AliITSCalibration *resp2= new AliITSCalibrationSSD("simulated");
SetCalibrationModel(GetITSgeom()->GetStartSSD(),resp2);
- AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(GetITSgeom());
- seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD
- s2->GetDz()*2.*kconv, // for now.
- s2->GetDy()*2.*kconv); // x,z,y full width in microns.
+ AliITSsegmentationSSD *seg2 = (AliITSsegmentationSSD*)
+ (GetITSgeom()->GetShape(kSSD));
seg2->SetPadSize(50.,0.); // strip x pitch in microns
seg2->SetNPads(384,0); // number of strips on each side.
seg2->SetLayer(5);
// Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
// AliITSvSPD02.
// In general it is automatically replaced by
- // the CreatMaterials routine defined in AliITSv?. Should the function
+ // the CreateMaterials routine defined in AliITSv?. Should the function
// CreateMaterials not exist for the geometry version you are using this
// one is used. See the definition found in AliITSv5 or the other routine
// for a complete definition.
// Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
// AliITSvSPD02.
// In general it is automatically replaced by
- // the CreatMaterials routine defined in AliITSv?. Should the function
+ // the CreateMaterials routine defined in AliITSv?. Should the function
// CreateMaterials not exist for the geometry version you are using this
// one is used. See the definition found in AliITSv5 or the other routine
// for a complete definition.
lad = 1;
det = mod+1;
t[0] = tt[mod][0]; t[1] = tt[mod][1]; t[2] = tt[mod][2];
- GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
+ GetITSgeom()->CreateMatrix(mod,lay,lad,det,kSPD,t,r);
npar=3;par[0]=0.64;par[1]=0.5*300.0E-4;par[2]=3.48;
GetITSgeom()->ReSetShape(kSPD,new AliITSgeomSPD425Short(npar,par));
} // end for det
mod = lay-1;
ig->GetGeometry(kndeep,lnam,lnum,t,r,idshape,npar,natt,par,att,
imat,imed);
- GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
+ GetITSgeom()->CreateMatrix(mod,lay,lad,det,kSPD,t,r);
if(!(GetITSgeom()->IsShapeDefined((Int_t)kSPD)))
GetITSgeom()->ReSetShape(kSPD,
new AliITSgeomSPD425Short(npar,par));
resp0->SetDistanceOverVoltage();
SetCalibrationModel(0,resp0);
- AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(GetITSgeom());
+ AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD();
seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
s0->GetDz()*2.*kconv, // for now.
s0->GetDy()*2.*kconv); // x,z,y full width in microns.
// Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
// AliITSvSSD03.
// In general it is automatically replaced by
- // the CreatMaterials routine defined in AliITSv?. Should the function
+ // the CreateMaterials routine defined in AliITSv?. Should the function
// CreateMaterials not exist for the geometry version you are using this
// one is used. See the definition found in AliITSv5 or the other routine
// for a complete definition.
// Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
// AliITSvSSD03.
// In general it is automatically replaced by
- // the CreatMaterials routine defined in AliITSv?. Should the function
+ // the CreateMaterials routine defined in AliITSv?. Should the function
// CreateMaterials not exist for the geometry version you are using this
// one is used. See the definition found in AliITSv5 or the other routine
// for a complete definition.
lad = 1;
det = mod+1;
t[0] = tt[mod][0]; t[1] = tt[mod][1]; t[2] = tt[mod][2];
- GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
+ GetITSgeom()->CreateMatrix(mod,lay,lad,det,kSSD,t,r);
npar=3;par[0]=3.5;par[1]=0.5*300.0E-4;par[2]=2.0;
mod = lay-1;
ig->GetGeometry(kndeep,lnam,lnum,t,r,idshape,npar,natt,par,att,
imat,imed);
- GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
+ GetITSgeom()->CreateMatrix(mod,lay,lad,det,kSSD,t,r);
//cout<<mod<<" "<<lay<<" "<<lad<<" "<<det<<endl;
//cout<<npar<<" "<<par[0]<<" "<<par[1]<<" "<<par[2]<<endl;
if(!(GetITSgeom()->IsShapeDefined((Int_t)kSSD)))
AliITSCalibration *resp0=new AliITSCalibrationSSD("simulated");
SetCalibrationModel(GetITSgeom()->GetStartSSD(),resp0);
- AliITSsegmentationSSD *seg0=new AliITSsegmentationSSD(GetITSgeom());
+ AliITSsegmentationSSD *seg0=new AliITSsegmentationSSD();
seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSSD
s0->GetDz()*2.*kconv, // for now.
s0->GetDy()*2.*kconv); // x,z,y full width in microns.
mod++;
ig->GetGeometry(kndeep,lnam,lnum,t,r,idshape,npar,natt,
par,att,imat,imed);
- GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
+ GetITSgeom()->CreateMatrix(mod,lay,lad,det,kSPD,t,r);
if(!(GetITSgeom()->IsShapeDefined((Int_t)kSPD)))
if(fMinorVersion==1){
GetITSgeom()->ReSetShape(kSPD,
par,att,imat,imed);
switch (lay){
case 3: case 4:
- GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
+ GetITSgeom()->CreateMatrix(mod,lay,lad,det,kSDD,t,r);
if(!(GetITSgeom()->IsShapeDefined(kSDD)))
GetITSgeom()->ReSetShape(kSDD,new AliITSgeomSDD256());
break;
case 5:
- GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
+ GetITSgeom()->CreateMatrix(mod,lay,lad,det,kSSD,t,r);
if(!(GetITSgeom()->IsShapeDefined(kSSD)))
GetITSgeom()->ReSetShape(kSSD,new AliITSgeomSSD275and75());
break;
case 6:
- GetITSgeom()->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
+ GetITSgeom()->CreateMatrix(mod,lay,lad,det,kSSD,t,r);
if(!(GetITSgeom()->IsShapeDefined(kSSD)))
GetITSgeom()->ReSetShape(kSSD,new AliITSgeomSSD75and275());
break;
#pragma link C++ class AliITSdigitSDD+;
#pragma link C++ class AliITSdigitSSD+;
#pragma link C++ class AliITSTransientDigit+;
+#pragma link C++ class AliITSInitGeometry+;
#pragma link C++ class AliITSgeom+;
#pragma link C++ class AliITSgeomMatrix-;
#pragma link C++ class AliITSgeomSPD+;
#pragma link C++ class AliITSgeomSDD+;
#pragma link C++ class AliITSgeomSSD+;
// Standard ITS detector class initilizers
-#pragma link C++ class AliITSgeomSPD300+;
-#pragma link C++ class AliITSgeomSPD425Short+;
-#pragma link C++ class AliITSgeomSPD425Long+;
-#pragma link C++ class AliITSgeomSDD256+;
-#pragma link C++ class AliITSgeomSDD300+;
-#pragma link C++ class AliITSgeomSSD175+;
-#pragma link C++ class AliITSgeomSSD275and75+;
-#pragma link C++ class AliITSgeomSSD75and275+;
-
+#pragma link C++ class AliITSgeomSPD300+;
+#pragma link C++ class AliITSgeomSPD425Short+;
+#pragma link C++ class AliITSgeomSPD425Long+;
+#pragma link C++ class AliITSgeomSDD256+;
+#pragma link C++ class AliITSgeomSDD300+;
+#pragma link C++ class AliITSgeomSSD175+;
+#pragma link C++ class AliITSgeomSSD275and75+;
+#pragma link C++ class AliITSgeomSSD75and275+;
#pragma link C++ class AliITSMap+;
#pragma link C++ class AliITSMapA1+;
AliITSgeomSPD.cxx \
AliITSgeomSDD.cxx \
AliITSgeomSSD.cxx \
+ AliITSInitGeometry.cxx \
AliITSLoader.cxx \
AliITSRecPoint.cxx \
AliITSclusterV2.cxx \
DHDR=ITSbaseLinkDef.h
-EINCLUDE:=$(ALICE)/geant3/TGeant3 TPC RAW
+EINCLUDE:=$(GEANT3_ROOT)/TGeant3 TPC RAW