X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HMPID%2FAliHMPIDv1.cxx;h=0a03db382d56dc66269e293302c2925a17433169;hb=4d2a737006e3329745d1fc8dc785238bb3fc50c0;hp=9ebb4fb2131d8d9f79c0c6fe787a80c7b8b97395;hpb=f3bae3e21e9ef2aabb7f5fa9bedccaad0a7a5308;p=u%2Fmrichter%2FAliRoot.git diff --git a/HMPID/AliHMPIDv1.cxx b/HMPID/AliHMPIDv1.cxx index 9ebb4fb2131..0a03db382d5 100644 --- a/HMPID/AliHMPIDv1.cxx +++ b/HMPID/AliHMPIDv1.cxx @@ -18,18 +18,17 @@ #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() #include //StepManager(),Hits2SDigits() #include //Hits2SDigits() #include //Hits2SDigits() -#include -#include #include //StepManager() #include //CreateMaterials() #include //CreateMaterials() -#include //CreateGeometry() +//#include //CreateGeometry() #include //DefineOpticalProperties() #include //DefineOpticalProperties() #include //IsLostByFresnel() @@ -43,7 +42,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)); } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -85,7 +84,7 @@ void AliHMPIDv1::CreateMaterials() 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() @@ -99,7 +98,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); @@ -202,11 +201,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 @@ -220,12 +221,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. + 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 ); @@ -234,6 +238,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; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -378,7 +389,9 @@ void AliHMPIDv1::Digits2Raw() } treeD->GetEntry(0); - AliHMPIDDigit::WriteRaw(DigLst()); + //AliHMPIDDigit::WriteRaw(DigLst()); + AliHMPIDRawStream *pRS=0x0; + pRS->WriteRaw(DigLst()); GetLoader()->UnloadDigits(); AliDebug(1,"Stop."); @@ -453,18 +466,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 - sdi.Raw(ddl,w32); - 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; @@ -493,12 +508,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 @@ -551,12 +567,14 @@ void AliHMPIDv1::StepManager() 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