X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=sidebyside;f=HMPID%2FAliHMPIDv1.cxx;h=fd22de9c86622040302d9fdcfe596cd71166aee2;hb=34fbdb5b37d67194b3aa60eaae5a96bace353520;hp=b22f83529ea55bca6f8174653055cae87cf8c7c0;hpb=49dfd67aa88e7184d97e80178ee27cec4a3a5b59;p=u%2Fmrichter%2FAliRoot.git diff --git a/HMPID/AliHMPIDv1.cxx b/HMPID/AliHMPIDv1.cxx index b22f83529ea..fd22de9c866 100644 --- a/HMPID/AliHMPIDv1.cxx +++ b/HMPID/AliHMPIDv1.cxx @@ -18,6 +18,7 @@ #include "AliHMPIDParam.h" //StepManager() #include "AliHMPIDHit.h" //Hits2SDigs(),StepManager() #include "AliHMPIDDigit.h" //Digits2Raw(), Raw2SDigits() +#include "AliHMPIDRawStream.h" //Digits2Raw(), Raw2SDigits() #include "AliRawReader.h" //Raw2SDigits() #include //StepManager() for gMC #include //StepHistory() @@ -27,12 +28,13 @@ #include //StepManager() #include //CreateMaterials() #include //CreateMaterials() -#include //CreateGeometry() +//#include //CreateGeometry() +#include //CreateMaterials() +#include //CreateMaterials() #include //DefineOpticalProperties() #include //DefineOpticalProperties() +#include #include //IsLostByFresnel() -#include //CreateMaterials() -#include //CreateMaterials() ClassImp(AliHMPIDv1) //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -41,7 +43,7 @@ void AliHMPIDv1::AddAlignableVolumes()const // 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)); } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -65,8 +67,8 @@ void AliHMPIDv1::CreateMaterials() Int_t matId=0; //tmp material id number Int_t unsens = 0, sens=1; //sensitive or unsensitive medium - Int_t itgfld = gAlice->Field()->Integ(); //type of field intergration 0 no field -1 user in guswim 1 Runge Kutta 2 helix 3 const field along z - Float_t maxfld = gAlice->Field()->Max(); //max field value + Int_t itgfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); //type of field intergration 0 no field -1 user in guswim 1 Runge Kutta 2 helix 3 const field along z + Float_t maxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); //max field value Float_t tmaxfd = -10.0; //max deflection angle due to magnetic field in one step Float_t deemax = - 0.2; //max fractional energy loss in one step Float_t stemax = - 0.1; //mas step allowed [cm] @@ -97,7 +99,7 @@ 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); @@ -200,11 +202,13 @@ void AliHMPIDv1::DefineOpticalProperties() 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 + TF2 *pRaIF=new TF2("HidxRad","sqrt(1+0.554*(1239.84/x)^2/((1239.84/x)^2-5769)-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 TF1 *pGaIF=new TF1("HidxGap","1+0.12489e-6/(2.62e-4 - x*x/1239.84/1239.84)" ,emin,emax); //?????? from where @@ -218,13 +222,15 @@ void AliHMPIDv1::DefineOpticalProperties() for(Int_t i=0;iEval(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. 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 ); @@ -233,6 +239,13 @@ void AliHMPIDv1::DefineOpticalProperties() 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; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -270,7 +283,7 @@ void AliHMPIDv1::GenFee(Float_t qtot) gMC->GetRandom()->RndmArray(2,ranf); //Sample direction cthf=ranf[0]*2-1.0; if(cthf<0) continue; - sthf = TMath::Sqrt((1 - cthf) * (1 + cthf)); + sthf = TMath::Sqrt((1. - cthf) * (1. + cthf)); phif = ranf[1] * 2 * TMath::Pi(); if(Double_t randomNumber=gMC->GetRandom()->Rndm()<=0.57) @@ -377,7 +390,9 @@ void AliHMPIDv1::Digits2Raw() } treeD->GetEntry(0); - AliHMPIDDigit::WriteRaw(DigLst()); + //AliHMPIDDigit::WriteRaw(DigLst()); + AliHMPIDRawStream *pRS=0x0; + pRS->WriteRaw(DigLst()); GetLoader()->UnloadDigits(); AliDebug(1,"Stop."); @@ -408,7 +423,7 @@ Float_t AliHMPIDv1::Fresnel(Float_t ene,Float_t pdoti, Bool_t pola) //FORMULAE FROM HANDBOOK OF OPTICS, 33.23 OR //W.R. HUNTER, J.O.S.A. 54 (1964),15 , J.O.S.A. 55(1965),1197 - Float_t sinin=TMath::Sqrt(1-pdoti*pdoti); + Float_t sinin=TMath::Sqrt((1.-pdoti)*(1.+pdoti)); Float_t tanin=sinin/pdoti; Float_t c1=cn*cn-ck*ck-sinin*sinin; @@ -452,18 +467,20 @@ Bool_t AliHMPIDv1::Raw2SDigits(AliRawReader *pRR) // Interface methode ivoked from AliSimulation to create a list of sdigits from raw digits. Events loop is done in AliSimulation // Arguments: pRR- raw reader // Returns: kTRUE on success (currently ignored in AliSimulation::ConvertRaw2SDigits()) - AliHMPIDDigit sdi; //tmp sdigit, raw digit will be converted to it + //AliHMPIDDigit sdi; //tmp sdigit, raw digit will be converted to it if(!GetLoader()->TreeS()) {MakeTree("S"); MakeBranch("S");} TClonesArray *pSdiLst=SdiLst(); Int_t iSdiCnt=0; //tmp list of sdigits for all chambers - pRR->Select("HMPID",0,13);//select all HMPID DDL files - 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 - if (!sdi.Raw(ddl,w32,pRR)) continue; - new((*pSdiLst)[iSdiCnt++]) AliHMPIDDigit(sdi); //add this digit to the tmp list - }//raw records loop + AliHMPIDRawStream stream(pRR); + while(stream.Next()) + { + for(Int_t iPad=0;iPadTreeS()->Fill(); GetLoader()->WriteSDigits("OVERWRITE");//write out sdigits SdiReset(); return kTRUE; @@ -492,12 +509,13 @@ void AliHMPIDv1::StepHistory() } TString flag="fanny combination"; - if(gMC->IsTrackAlive()) - if(gMC->IsTrackEntering()) flag="enters to"; - else if(gMC->IsTrackExiting()) flag="exits from"; - else if(gMC->IsTrackInside()) flag="inside"; - else - if(gMC->IsTrackStop()) flag="stoped in"; + if(gMC->IsTrackAlive()) { + if(gMC->IsTrackEntering()) flag="enters to"; + else if(gMC->IsTrackExiting()) flag="exits from"; + else if(gMC->IsTrackInside()) flag="inside"; + } else { + if(gMC->IsTrackStop()) flag="stopped in"; + } Int_t vid=0,copy=0; TString path=gMC->CurrentVolName(); path.Prepend("-");path.Prepend(gMC->CurrentVolOffName(1));//current volume and his mother are always there