/************************************************************************** * 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. * **************************************************************************/ //************************************************************************ // Inner Traking System geometry v11 // // Based on ROOT geometrical modeler // Set #define WITHROOT in TGeant3.h // // B. Nilsen, L. Gaudichet //************************************************************************ //#include #include #include #include "AliITS.h" #include "AliITSDetType.h" #include "AliITSGeant3Geometry.h" #include "AliITSgeom.h" #include "AliITSgeomSDD.h" #include "AliITSgeomSPD.h" #include "AliITSgeomSSD.h" #include "AliITShit.h" #include "AliITSresponseSDD.h" #include "AliITSresponseSPD.h" #include "AliITSresponseSSD.h" #include "AliITSsegmentationSDD.h" #include "AliITSsegmentationSPD.h" #include "AliITSsegmentationSSD.h" #include "AliITSv11.h" #include "AliMagF.h" #include "AliRun.h" #include "AliTrackReference.h" #include "AliMC.h" #include #include #include //#include "AliITSv11GeometrySPD.h" #include "AliITSv11GeometrySDD.h" //#include "AliITSv11GeometrySupport.h" ClassImp(AliITSv11) AliITSv11::AliITSv11() : AliITS() { // Standard default constructor for the ITS version 11. fGeomDetOut=kFALSE; fGeomDetIn=kFALSE; fMajorVersion=11; fMinorVersion=0; Int_t i; for(i=0;i<60;i++) fRead[i] = '\0'; for(i=0;i<60;i++) fWrite[i] = '\0'; for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0'; strncpy(fRead,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymmFMD.det",60); SetEUCLID(kFALSE); // fSPDgeom = new AliITSv11GeometrySPD(); fSDDgeom = new AliITSv11GeometrySDD(); // fSupgeom = new AliITSv11GeometrySupport(); fIdN = 1; fIdName = new TString[fIdN]; fIdName[0] = fSDDgeom->GetSenstiveVolumeMame(); fIdSens = new Int_t[fIdN]; for(Int_t i=0; iGetSenstiveVolumeMame(); fIdSens = new Int_t[fIdN]; for(Int_t i=0; iGetSenstiveVolumeMame(); fIdSens = new Int_t[fIdN]; for(Int_t i=0; iGetTopVolume(); TGeoPcon *sITS = new TGeoPcon("ITS Top Volume",0.0,360.0,2); // DefineSection(section number, Z, Rmin, Rmax). const Double_t kcm = 1.0; sITS->DefineSection(0,-300.0*kcm,0.01*kcm,50.0*kcm); sITS->DefineSection(1,+300.0*kcm,0.01*kcm,50.0*kcm); TGeoMedium *air = gGeoManager->GetMedium("ITSair"); TGeoVolume *vITS = new TGeoVolume("vITS",sITS,air); vITS->SetVisibility(kFALSE); vALIC->AddNode(vITS,1,0); // fSPDgeom->CenteralSPD(vITS); // fSDDgeom->AddOnlyLay3Ladder(0,1); // fSDDgeom->AddOnlyLay4Ladder(0,1); fSDDgeom->Layer3(vITS); fSDDgeom->Layer4(vITS); // fSupgeom->SPDCone(vITS); // fSupgeom->SPDThermalSheald(vITS); // fSupgeom->SDDCone(vITS); // fSupgeom->SSDCone(vITS); // fSupgeom->ServicesCableSupport(vITS); } //______________________________________________________________________ void AliITSv11::CreateMaterials(){ // // Create ITS materials // Defined media here should correspond to the one defined in galice.cuts // File which is red in (AliMC*) fMCApp::Init() { ReadTransPar(); } // Int_t ifield = gAlice->Field()->Integ(); Float_t fieldm = gAlice->Field()->Max(); Float_t tmaxfd = 0.1; // 1.0; // Degree Float_t stemax = 1.0; // cm Float_t deemax = 0.1; // 30.0; // Fraction of particle's energy 0GetLay3NLadders(); ndet[2]=6; nlad[3]= fSDDgeom->GetLay4NLadders(); ndet[3]=8; nlad[4]= 0; ndet[4]=0; nlad[5]= 0; ndet[5]=0; Int_t nSPD = nlad[0]*ndet[0]+nlad[1]*ndet[1]; Int_t nSDD = nlad[2]*ndet[2]+nlad[3]*ndet[3]; Int_t nSSD = nlad[4]*ndet[4]+nlad[5]*ndet[5]; Int_t nModTot = nSPD + nSDD + nSSD; if (fITSgeom) delete fITSgeom; fITSgeom = new AliITSgeom(0,knlayers,nlad,ndet,nModTot); //*************************************************** // Set default shapes // (These default shapes won't exist anymore when all // layers are coded) const Float_t kDxyzSPD[] = {0.6400, 0.015, 3.480}; if(!(fITSgeom->IsShapeDefined(kSPD))) fITSgeom->ReSetShape(kSPD, new AliITSgeomSPD425Short(3,(Float_t *)kDxyzSPD)); const Float_t kDxyzSSD[] = {3.6500, 0.0150, 2.000}; if(!(fITSgeom->IsShapeDefined(kSSD))) fITSgeom->ReSetShape(kSSD, new AliITSgeomSSD75and275(3,(Float_t *)kDxyzSSD)); //***************************************** fSDDgeom->ExportSensorGeometry(fITSgeom, +3, 0); //SDD return; } //______________________________________________________________________ void AliITSv11::Init(){ // // Initialise the ITS after it has been created. // Int_t i; for(i=0;i<20;i++) printf("*"); printf( " ITSv%i.%i_Init ", fMajorVersion,fMinorVersion ); for(i=0;i<20;i++) printf("*"); printf("\n"); // Create geometry if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60); if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60); if(fITSgeom!=0) delete fITSgeom; fITSgeom = new AliITSgeom(); if(fGeomDetIn) fITSgeom->ReadNewFile(fRead); else this->InitAliITSgeom(); if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite); // Initialize AliITS AliITS::Init(); for(i=0;i<40+16;i++) printf("*"); printf("\n"); } //______________________________________________________________________ void AliITSv11::SetDefaults(){ // // Set response ans segmentation models for SPD, SDD and SSD // printf("AliITSv11::SetDefaults :\n"); const Float_t kconv = 1.0e+04; // convert cm to microns AliITSDetType *iDetType; AliITSgeomSPD *s0; AliITSgeomSDD *s1; AliITSgeomSSD *s2; Int_t i; Float_t bx[256],bz[280]; //================================================ SPD iDetType=DetType(kSPD); s0 = (AliITSgeomSPD*) fITSgeom->GetShape(kSPD);// Get shape info. Do it this way for now. // If some SPD detectors have been inserted in t if (s0) { AliITSresponse *resp0=new AliITSresponseSPD(); SetResponseModel(kSPD,resp0); AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(fITSgeom); 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->SetNPads(256,160);// Number of Bins in x and z 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. seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now. SetSegmentationModel(kSPD,seg0); // set digit and raw cluster classes to be used const char *kData0=(iDetType->GetResponseModel())->DataType(); if (strstr(kData0,"real")) iDetType->ClassNames("AliITSdigit", "AliITSRawClusterSPD"); else iDetType->ClassNames("AliITSdigitSPD","AliITSRawClusterSPD"); }; //================================================ SDD iDetType=DetType(kSDD); s1 = (AliITSgeomSDD*) fITSgeom->GetShape(kSDD); if (s1) { AliITSresponseSDD *resp1 = new AliITSresponseSDD("simulated"); AliITSsegmentationSDD *seg1 = new AliITSsegmentationSDD(fITSgeom,resp1); seg1->SetDetSize(s1->GetDx()*kconv, s1->GetDz()*4*kconv, // z in 2th and y in 3th position in s1->GetDy()*4*kconv); // AliITSsegmentation::SetDetSize()... seg1->SetNPads(256, 256); SetResponseModel(kSDD, resp1); SetSegmentationModel(kSDD, seg1); const char *kData1 = (iDetType->GetResponseModel())->DataType(); const char *kopt = iDetType->GetResponseModel()->ZeroSuppOption(); if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){ iDetType->ClassNames("AliITSdigit","AliITSRawClusterSDD"); } else iDetType->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD"); }; //================================================ SSD Layer 5 iDetType=DetType(kSSD); s2 = (AliITSgeomSSD*) fITSgeom->GetShape(kSSD);// Get shape info. Do it this way for now. if (s2) { AliITSresponse *resp2=new AliITSresponseSSD("simulated"); SetResponseModel(kSSD,resp2); AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(fITSgeom); 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->SetPadSize(95.,0.); // strip x pitch in microns seg2->SetNPads(768,0); // number of strips on each side. seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side. 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=(iDetType->GetResponseModel())->DataType(); if(strstr(kData2,"real") ) iDetType->ClassNames("AliITSdigit", "AliITSRawClusterSSD"); else iDetType->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD"); }; if(kNTYPES>3){ Warning("SetDefaults", "Only the four basic detector types are initialised!"); }// end if return; }; //______________________________________________________________________ void AliITSv11::DrawModule() const{ } //______________________________________________________________________ void AliITSv11::StepManager(){ // // Called for every step in the ITS, then calles the AliITShit class // creator with the information to be recoreded about that hit. // Int_t copy, id; TLorentzVector position, momentum; static TLorentzVector position0; static Int_t stat0=0; if(!(this->IsActive())){ return; } // end if !Active volume. if(!(gMC->TrackCharge())) return; id=gMC->CurrentVolID(copy); Bool_t sensvol = kFALSE; for(Int_t kk = 0; kk < fIdN; kk++) if(id == fIdSens[kk]) sensvol = kTRUE; if (sensvol && (gMC->IsTrackExiting())) { copy = fTrackReferences->GetEntriesFast(); TClonesArray &lTR = *fTrackReferences; // Fill TrackReference structure with this new TrackReference. new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber()); } // if Outer ITS mother Volume Int_t vol[5]; TClonesArray &lhits = *fHits; // // Track status vol[3] = 0; vol[4] = 0; // Fill hit structure. if(gMC->IsTrackInside()) vol[3] += 1; if(gMC->IsTrackEntering()) vol[3] += 2; if(gMC->IsTrackExiting()) vol[3] += 4; if(gMC->IsTrackOut()) vol[3] += 8; if(gMC->IsTrackDisappeared()) vol[3] += 16; if(gMC->IsTrackStop()) vol[3] += 32; if(gMC->IsTrackAlive()) vol[3] += 64; // Only entering charged tracks if(!(gMC->TrackCharge())) return; if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) { fSDDgeom->GetCurrentLayLaddDet(vol[0], vol[2], vol[1]); // vol[2], vol[1]) : in this order because the ladder // index and the det. index are exchanged in the constructor // of AliITShit ... ??? } else { return; // not an ITS volume? }; gMC->TrackPosition(position); gMC->TrackMomentum(momentum); vol[4] = stat0; if(gMC->IsTrackEntering()){ position0 = position; stat0 = vol[3]; return; } // end if IsEntering // Fill hit structure with this new hit. new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, gMC->Edep(),gMC->TrackTime(),position, position0,momentum); // position0 = position; stat0 = vol[3]; return; };