#include <AliStack.h> //StepManager(),Hits2SDigits()
#include <AliLoader.h> //Hits2SDigits()
#include <AliRunLoader.h> //Hits2SDigits()
-#include <AliConst.h>
-#include <AliPDG.h>
#include <AliMC.h> //StepManager()
#include <AliRun.h> //CreateMaterials()
#include <AliMagF.h> //CreateMaterials()
// Associates the symbolic volume name with the corresponding volume path. Interface method from AliModule invoked from AliMC
// Arguments: none
// Returns: none
- for(Int_t i=AliHMPIDDigit::kMinCh;i<=AliHMPIDDigit::kMaxCh;i++)
+ for(Int_t i=AliHMPIDParam::kMinCh;i<=AliHMPIDParam::kMaxCh;i++)
gGeoManager->SetAlignableEntry(Form("/HMPID/Chamber%i",i),Form("ALIC_1/HMPID_%i",i));
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AliMaterial(++matId,"W" ,aW ,zW ,dW ,radW ,absW ); AliMedium(kW ,"W" , matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
AliMaterial(++matId,"Al" ,aAl ,zAl ,dAl ,radAl ,absAl ); AliMedium(kAl ,"Al" , matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
- DefineOpticalProperties();
+// DefineOpticalProperties(); // NOT TO BE CALLED BY USER CODE !!!
}//void AliHMPID::CreateMaterials()
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void AliHMPIDv1::CreateGeometry()
TGeoVolume *pRich=gGeoManager->MakeBox("HMPID",gGeoManager->GetMedium("HMPID_CH4"),dx=(6*mm+1681*mm+6*mm)/2, //main HMPID volume
dy=(6*mm+1466*mm+6*mm)/2,
dz=(80*mm+40*mm)*2/2); //x,y taken from 2033P1 z from p84 TDR
- for(Int_t iCh=AliHMPIDDigit::kMinCh;iCh<=AliHMPIDDigit::kMaxCh;iCh++){//place 7 chambers
+ for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){//place 7 chambers
TGeoHMatrix *pMatrix=new TGeoHMatrix;
AliHMPIDParam::IdealPosition(iCh,pMatrix);
gGeoManager->GetVolume("ALIC")->AddNode(pRich,iCh,pMatrix);
const Int_t kNbins=30; //number of photon energy points
Float_t emin=5.5,emax=8.5; //Photon energy range,[eV]
Float_t aEckov [kNbins];
+ Double_t dEckov [kNbins];
Float_t aAbsRad[kNbins], aAbsWin[kNbins], aAbsGap[kNbins], aAbsMet[kNbins];
Float_t aIdxRad[kNbins], aIdxWin[kNbins], aIdxGap[kNbins], aIdxMet[kNbins], aIdxPc[kNbins];
Float_t aQeAll [kNbins], aQePc [kNbins];
+ Double_t dReflMet[kNbins], dQePc[kNbins];
TF2 *pRaIF=new TF2("HidxRad","sqrt(1+0.554*(1239.84/x)^2/((1239.84/x)^2-5796)-0.0005*(y-20))" ,emin,emax,0,50); //DiMauro mail temp 0-50 degrees C
TF1 *pWiIF=new TF1("HidxWin","sqrt(1+46.411/(10.666*10.666-x*x)+228.71/(18.125*18.125-x*x))" ,emin,emax); //SiO2 idx TDR p.35
for(Int_t i=0;i<kNbins;i++){
Float_t eV=emin+0.1*i; //Ckov energy in eV
aEckov [i] =1e-9*eV; //Ckov energy in GeV
+ dEckov [i] = aEckov[i];
aAbsRad[i]=pRaAF->Eval(eV); aIdxRad[i]=1.292;//pRaIF->Eval(eV,20); //Simulation for 20 degress C
aAbsWin[i]=pWiAF->Eval(eV); aIdxWin[i]=1.5787;//pWiIF->Eval(eV);
- aAbsGap[i]=pGaAF->Eval(eV); aIdxGap[i]=1.0005;//pGaIF->Eval(eV); aQeAll[i] =1; //QE for all other materials except for PC must be 1.
+ aAbsGap[i]=pGaAF->Eval(eV); aIdxGap[i]=1.0005;//pGaIF->Eval(eV);
+ aQeAll[i] =1; //QE for all other materials except for PC must be 1.
aAbsMet[i] =0.0001; aIdxMet[i]=0; //metal ref idx must be 0 in order to reflect photon
aIdxPc [i]=1; aQePc [i]=pQeF->Eval(eV); //PC ref idx must be 1 in order to apply photon to QE conversion
-
+ dQePc [i]=pQeF->Eval(eV);
+ dReflMet[i] = 0.; // no reflection on the surface of the pc (?)
}
gMC->SetCerenkov((*fIdtmed)[kC6F14] , kNbins, aEckov, aAbsRad , aQeAll , aIdxRad );
gMC->SetCerenkov((*fIdtmed)[kSiO2] , kNbins, aEckov, aAbsWin , aQeAll , aIdxWin );
gMC->SetCerenkov((*fIdtmed)[kW] , kNbins, aEckov, aAbsMet , aQeAll , aIdxMet ); //n=0 means reflect photons
gMC->SetCerenkov((*fIdtmed)[kCsI] , kNbins, aEckov, aAbsMet , aQePc , aIdxPc ); //n=1 means convert photons
gMC->SetCerenkov((*fIdtmed)[kAl] , kNbins, aEckov, aAbsMet , aQeAll , aIdxMet );
+
+ // Define a skin surface for the photocatode to enable 'detection' in G4
+ gMC->DefineOpSurface("surfPc", kGlisur /*kUnified*/,kDielectric_metal,kPolished, 0.);
+ gMC->SetMaterialProperty("surfPc", "EFFICIENCY", kNbins, dEckov, dQePc);
+ gMC->SetMaterialProperty("surfPc", "REFLECTIVITY", kNbins, dEckov, dReflMet);
+ gMC->SetSkinSurface("skinPc", "Rpc", "surfPc");
+
delete pRaAF;delete pWiAF;delete pGaAF; delete pRaIF; delete pWiIF; delete pGaIF; delete pQeF;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
UInt_t w32=0;
while(pRR->ReadNextInt(w32)){//raw records loop (in selected DDL files)
UInt_t ddl=pRR->GetDDLID(); //returns 0,1,2 ... 13
- sdi.Raw(ddl,w32);
+ if(!sdi.Raw(ddl,w32,pRR)) continue;
new((*pSdiLst)[iSdiCnt++]) AliHMPIDDigit(sdi); //add this digit to the tmp list
}//raw records loop
GetLoader()->TreeS()->Fill(); GetLoader()->WriteSDigits("OVERWRITE");//write out sdigits
eloss=0; //reset Eloss collector
gMC->TrackPosition(in[0],in[1],in[2]); //take position at the entrance
}else if(gMC->IsTrackExiting()||gMC->IsTrackStop()||gMC->IsTrackDisappeared()){ //exiting or disappeared
- eloss +=gMC->Edep(); //take into account last step Eloss
+ eloss +=gMC->Edep(); //take into account last step Eloss
gMC->CurrentVolOffID(1,copy); //take current chamber since geometry tree is HMPID-Rgap
Int_t tid= gMC->GetStack()->GetCurrentTrackNumber(); //take TID
Int_t pid= gMC->TrackPid(); //take PID
Double_t out[3]; gMC->TrackPosition(out[0],out[1],out[2]); //take MARS position at exit
- out[0]=0.5*(out[0]+in[0]); out[1]=0.5*(out[1]+in[1]); out[1]=0.5*(out[1]+in[1]); //take hit position at the anod plane
+ out[0]=0.5*(out[0]+in[0]); //>
+ out[1]=0.5*(out[1]+in[1]); //take hit position at the anod plane
+ out[2]=0.5*(out[2]+in[2]); //>
Float_t xl,yl;AliHMPIDParam::Instance()->Mars2Lors(copy,out,xl,yl); //take LORS position
new((*fHits)[fNhits++])AliHMPIDHit(copy,eloss,pid,tid,xl,yl,out); //HIT for MIP, position near anod plane, eloss will be set to Q
GenFee(eloss); //generate feedback photons