FairRoot/PandaRoot
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
PndRich Class Reference

#include <PndRich.h>

Inheritance diagram for PndRich:

Public Member Functions

 PndRich (const char *Name, Bool_t Active)
 
 PndRich ()
 
virtual ~PndRich ()
 
virtual void Initialize ()
 
virtual Bool_t ProcessHits (FairVolume *v=0)
 
virtual void Register ()
 
virtual TClonesArray * GetCollection (Int_t iColl) const
 
virtual void Reset ()
 
void ConstructGeometry ()
 
void ConstructOpGeometry ()
 
void SetRunCherenkov (Bool_t const &ch)
 
void SetGeoVersion (UInt_t const &version)
 
void UseProtection (Bool_t const &up)
 
bool CheckIfSensitive (std::string name)
 
Double_t lhcbaerindex (Double_t n400, Double_t wl)
 
PndRichPDPointAddPDPoint (Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, UInt_t EventId=0)
 
PndRichBarPointAddBarPoint (Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Int_t pdgCode, Double_t thetaC, Int_t eventID, Double_t mass, TVector3 pos0, TVector3 mom0)
 
virtual void CopyClones (TClonesArray *, TClonesArray *, Int_t)
 
virtual void SetSpecialPhysicsCuts ()
 
virtual void EndOfEvent ()
 
virtual void FinishPrimary ()
 
virtual void FinishRun ()
 
virtual void BeginPrimary ()
 
virtual void PostTrack ()
 
virtual void PreTrack ()
 
virtual void BeginEvent ()
 

Public Attributes

std::vector< std::string > fListOfSensitives
 

Private Member Functions

 PndRich (const PndRich &)
 
PndRichoperator= (const PndRich &)
 
void DefGeoVersion ()
 

Private Attributes

Int_t fTrackID
 
Int_t fVolumeID
 track index More...
 
TLorentzVector fPos
 volume id More...
 
TLorentzVector fMom
 position at entrance More...
 
Double_t fTime
 momentum at entrance More...
 
Double_t fLength
 time More...
 
Double_t fELoss
 length More...
 
PndRichGeofGeo
 energy loss More...
 
PndGeoHandlingfGeoH
 
Bool_t fUseProtection
 ///< converter for detector names More...
 
Bool_t fRunCherenkov
 
UInt_t fGeoVersion
 
TClonesArray * fPndRichPDPointCollection
 
TClonesArray * fPndRichBarPointCollection
 
std::vector< Double_tfWlPhoton
 
std::vector< Double_tfPDE
 
std::map< Int_t, Int_t > trackid
 
Double_t fnOpt
 
Double_t fZabar
 

Detailed Description

Definition at line 16 of file PndRich.h.

Constructor & Destructor Documentation

PndRich::PndRich ( const char *  Name,
Bool_t  Active 
)

Name : Detector Name Active: kTRUE for active detectors (ProcessHits() will be called) kFALSE for inactive detectors

Definition at line 64 of file PndRich.cxx.

References fGeoH, fGeoVersion, fListOfSensitives, and PndGeoHandling::Instance().

65  : FairDetector(name, active, kRICH),
66  fTrackID(-1),
67  fVolumeID(-1),
68  fPos(),
69  fMom(),
70  fTime(-1.),
71  fLength(-1.),
72  fELoss(-1),
73  fGeo(new PndRichGeo()),
74  fGeoH(NULL),
75  fUseProtection(kFALSE),
76  fRunCherenkov(kFALSE),
77  fPndRichPDPointCollection(new TClonesArray("PndRichPDPoint")),
78  fPndRichBarPointCollection(new TClonesArray("PndRichBarPoint"))
79 {
80  fListOfSensitives.push_back("Sensor");
81  if(fVerboseLevel > 0){
82  std::cout<<"-I- PndRich: fListOfSensitives contains:";
83  for(size_t k=0; k<fListOfSensitives.size(); k++)
84  std::cout<<"\n\t"<<fListOfSensitives[k];
85  std::cout<<std::endl;
86  }
87 
88  if ( fGeoH == NULL )
90  fGeoVersion = 313; //default geometry
91  std::cout<<"-I- PndRich:"<<std::endl;
92 }
PndGeoHandling * fGeoH
Definition: PndRich.h:109
TLorentzVector fMom
position at entrance
Definition: PndRich.h:103
UInt_t fGeoVersion
Definition: PndRich.h:113
Double_t fLength
time
Definition: PndRich.h:105
Double_t fTime
momentum at entrance
Definition: PndRich.h:104
TLorentzVector fPos
volume id
Definition: PndRich.h:102
TClonesArray * fPndRichBarPointCollection
Definition: PndRich.h:118
Bool_t fRunCherenkov
Definition: PndRich.h:112
Bool_t fUseProtection
///&lt; converter for detector names
Definition: PndRich.h:111
Double_t fELoss
length
Definition: PndRich.h:106
std::vector< std::string > fListOfSensitives
Definition: PndRich.h:58
static PndGeoHandling * Instance()
TString name
TClonesArray * fPndRichPDPointCollection
Definition: PndRich.h:117
Int_t fVolumeID
track index
Definition: PndRich.h:101
Int_t fTrackID
Definition: PndRich.h:100
PndRichGeo * fGeo
energy loss
Definition: PndRich.h:108
PndRich::PndRich ( )

default constructor

Definition at line 35 of file PndRich.cxx.

References fGeoH, fGeoVersion, fListOfSensitives, and PndGeoHandling::Instance().

36  : FairDetector("PndRich", kTRUE, kRICH),
37  fTrackID(-1),
38  fVolumeID(-1),
39  fPos(),
40  fMom(),
41  fTime(-1.),
42  fLength(-1.),
43  fELoss(-1),
44  fGeo(new PndRichGeo()),
45  fGeoH(NULL),
46  fUseProtection(kFALSE),
47  fRunCherenkov(kFALSE),
48  fPndRichPDPointCollection(new TClonesArray("PndRichPDPoint")),
49  fPndRichBarPointCollection(new TClonesArray("PndRichBarPoint"))
50 {
51  fListOfSensitives.push_back("Sensor");
52  if(fVerboseLevel > 0){
53  std::cout<<"-I- PndRich: fListOfSensitives contains:";
54  for(size_t k=0; k<fListOfSensitives.size(); k++)
55  std::cout<<"\n\t"<<fListOfSensitives[k];
56  std::cout<<std::endl;
57  }
58 
59  if ( fGeoH == NULL )
61  fGeoVersion = 313; //default geometry
62 }
PndGeoHandling * fGeoH
Definition: PndRich.h:109
TLorentzVector fMom
position at entrance
Definition: PndRich.h:103
UInt_t fGeoVersion
Definition: PndRich.h:113
Double_t fLength
time
Definition: PndRich.h:105
Double_t fTime
momentum at entrance
Definition: PndRich.h:104
TLorentzVector fPos
volume id
Definition: PndRich.h:102
TClonesArray * fPndRichBarPointCollection
Definition: PndRich.h:118
Bool_t fRunCherenkov
Definition: PndRich.h:112
Bool_t fUseProtection
///&lt; converter for detector names
Definition: PndRich.h:111
Double_t fELoss
length
Definition: PndRich.h:106
std::vector< std::string > fListOfSensitives
Definition: PndRich.h:58
static PndGeoHandling * Instance()
TClonesArray * fPndRichPDPointCollection
Definition: PndRich.h:117
Int_t fVolumeID
track index
Definition: PndRich.h:101
Int_t fTrackID
Definition: PndRich.h:100
PndRichGeo * fGeo
energy loss
Definition: PndRich.h:108
PndRich::~PndRich ( )
virtual

destructor

Definition at line 94 of file PndRich.cxx.

References fPndRichBarPointCollection, and fPndRichPDPointCollection.

95 {
97  fPndRichPDPointCollection->Delete();
99  }
101  fPndRichBarPointCollection->Delete();
103  }
104 }
TClonesArray * fPndRichBarPointCollection
Definition: PndRich.h:118
TClonesArray * fPndRichPDPointCollection
Definition: PndRich.h:117
PndRich::PndRich ( const PndRich )
private

Member Function Documentation

PndRichBarPoint * PndRich::AddBarPoint ( Int_t  trackID,
Int_t  detID,
TVector3  pos,
TVector3  mom,
Double_t  time,
Double_t  length,
Int_t  pdgCode,
Double_t  thetaC,
Int_t  eventID,
Double_t  mass,
TVector3  pos0,
TVector3  mom0 
)

Definition at line 675 of file PndRich.cxx.

References fPndRichBarPointCollection.

Referenced by ProcessHits().

681 {
682  TClonesArray& clref = *fPndRichBarPointCollection;
683  Int_t size = clref.GetEntriesFast();
684  return new(clref[size]) PndRichBarPoint(trackID, detID, pos, mom,
685  time, length, pdgCode,
686  thetaC, eventID, mass,
687  pos0, mom0);
688 }
TVector3 pos
Double_t mom
Definition: plot_dirc.C:14
TClonesArray * fPndRichBarPointCollection
Definition: PndRich.h:118
Double_t thetaC
Definition: plot_dirc.C:16
PndRichPDPoint * PndRich::AddPDPoint ( Int_t  trackID,
Int_t  detID,
TVector3  pos,
TVector3  mom,
Double_t  time,
Double_t  length,
Double_t  eLoss,
UInt_t  EventId = 0 
)

This method is an example of how to add your own point of type PndRichPoint to the clones array

Definition at line 664 of file PndRich.cxx.

References fPndRichPDPointCollection.

Referenced by ProcessHits().

668 {
669  TClonesArray& clref = *fPndRichPDPointCollection;
670  Int_t size = clref.GetEntriesFast();
671  return new(clref[size]) PndRichPDPoint(trackID, detID, pos, mom,
672  time, length, eLoss, EventId);
673 }
TVector3 pos
Double_t mom
Definition: plot_dirc.C:14
TClonesArray * fPndRichPDPointCollection
Definition: PndRich.h:117
void PndRich::BeginEvent ( )
virtual

Definition at line 302 of file PndRich.cxx.

303 {
304 /* TList *listOfMedia = gGeoManager->GetListOfMedia();
305  TListIter iter(listOfMedia);
306  TGeoMedium* medium = NULL;
307 
308  while( (medium = (TGeoMedium*)iter.Next()) ) {
309  cout << "medium->GetName() = " << medium->GetName() << endl;
310  }
311 
312  TList *listOfMaterials = gGeoManager->GetListOfMaterials();
313  TListIter iter1(listOfMaterials);
314  TGeoMaterial* material = NULL;
315 
316  while( (material = (TGeoMaterial*)iter1.Next()) ) {
317  TObject *obj = material->GetCerenkovProperties();
318  cout << "material->GetName() = " << material->GetName() <<
319  " " << material->GetDensity() <<
320  " " << material->GetFWExtension() << endl;
321  }
322 
323  TObjArray *listOfVolumes = gGeoManager->GetListOfVolumes();
324  TGeoVolume* volume = NULL;
325 
326  cout << "listOfVolumes->GetSize() = " << listOfVolumes->GetSize() << endl;
327  for(Int_t i=0; i<listOfVolumes->GetSize(); i++){
328  volume = (TGeoVolume*)listOfVolumes->At(i);
329  if (volume) {
330  medium = volume->GetMedium();
331  material = volume->GetMaterial();
332  cout << "volume->GetName() = " << volume->GetName() <<
333  " " << medium->GetName() << " " << material->GetName() <<endl;
334  }
335  }
336 
337  size_t nm = G4NistManager::Instance()->GetNumberOfElements();
338  cout << "GetNumberOfElements = " << nm << endl;
339 */
340 }
virtual void PndRich::BeginPrimary ( )
inlinevirtual

Definition at line 90 of file PndRich.h.

90 {;}
bool PndRich::CheckIfSensitive ( std::string  name)

Definition at line 655 of file PndRich.cxx.

References fListOfSensitives, and i.

655  {
656  for (size_t i = 0; i < fListOfSensitives.size(); i++){
657  if (name.find(fListOfSensitives[i]) != std::string::npos)
658  return true;
659  }
660  return false;
661 }
Int_t i
Definition: run_full.C:25
std::vector< std::string > fListOfSensitives
Definition: PndRich.h:58
TString name
void PndRich::ConstructGeometry ( )

Create the detector geometry

If you are using the standard ASCII input for the geometry just copy this and use it for your detector, otherwise you can implement here you own way of constructing the geometry.

Definition at line 391 of file PndRich.cxx.

References Bool_t, fRun, geoFace, geoLoad, PndRichGeoPar::GetGeoPassiveNodes(), PndRichGeoPar::GetGeoSensitiveNodes(), par, rtdb, and TString.

392 {
393  TString fileName = GetGeometryFileName();
394  if(fileName.EndsWith(".root")) {
395  ConstructRootGeometry();
396 
397 //-------------------------------------------------------------
398 /* if (fUseProtection) {
399 
400  Int_t n, z, ncomponents; //number of nucleon in a isotope
401  TString symbol;
402  Double_t abundance, a, density;
403 
404  C = new TGeoElement("Carbon", "C", z=6, n=12, a=12.0107);
405  H = new TGeoElement("Hydrogen", "H", z=1, n=1, a=1.00794);
406 
407  B10 = new TGeoIsotope("B10", z=5,n=10,a=10.0129370);
408  B11 = new TGeoIsotope("B11", z=5,n=11,a=11.0093054);
409 
410  B = new TGeoElement ("Boron",symbol="B",ncomponents=2);
411  B->AddIsotope(B10,19.8);
412  B->AddIsotope(B11,80.2);
413 
414  matRcihProt = (TGeoMaterial*) ( new TGeoMixture ("RichProtectionMaterial", 3, density=0.95) );
415  ((TGeoMixture*)matRcihProt)->AddElement(C,0.813467);
416  ((TGeoMixture*)matRcihProt)->AddElement(H,0.136533);
417  ((TGeoMixture*)matRcihProt)->AddElement(B,0.05);
418 
419  gGeoManager->AddMaterial(matRcihProt);
420 
421  med = new TGeoMedium("RichProtectionMedium",1000,matRcihProt);
422 
423  TGeoVolume *alRichBoxAir = gGeoManager->GetVolume("RichAlBoxAir");
424 
425  // Polyethilene protection
426  std::vector<Double_t> rpWidth;
427  rpWidth.push_back(5);
428  //rpWidth.push_back(1);
429  //rpWidth.push_back(1);
430  //rpWidth.push_back(1);
431  //rpWidth.push_back(1);
432  std::vector<Double_t> rpHoleWidth;
433  rpHoleWidth.push_back(10);
434  //rpHoleWidth.push_back(40);
435  //rpHoleWidth.push_back(30);
436  //rpHoleWidth.push_back(20);
437  //rpHoleWidth.push_back(10);
438  UInt_t numberOfLayers = rpWidth.size();
439  TString rpUnity = Form("( ");
440  std::vector<TGeoBBox*> lRichProtection(numberOfLayers);
441  std::vector<TGeoTranslation*> rpTrans(numberOfLayers);
442  std::vector<TGeoCompositeShape*> richProtectionCS(numberOfLayers);
443  std::vector<TGeoVolume*> richProtection(numberOfLayers);
444  std::vector<TGeoBBox*> lRichProtectionHole(numberOfLayers);
445 
446  DefGeoVersion();
447  fGeo->init(fGeoVersion);
448  TVector3 aerogelOffset = fGeo->aerogelOffset();
449  TVector3 alBoxSize = fGeo->alBoxSize();
450  TVector3 aerogelSize = fGeo->aerogelSize();
451  std::vector<Double_t> phDetY = fGeo->phDetY();
452 
453  Double_t zrp = aerogelOffset.Z()-alBoxSize.Z()/2+70;
454  for(UInt_t ia=0; ia<numberOfLayers; ia++) {
455  Double_t rpThickness = rpWidth[ia];
456  zrp += rpThickness/2;
457 
458  TString rpName = Form("rp%d",ia);
459  TString rpTransName = Form("rpTrans%d",ia);
460  TString rpMedia = Form("RichProtectionMaterial");
461  TString rpCSName = Form("RichProtectionCS%d",ia);
462  TString richProtectionName = Form("RichProtectionSensor%d",ia);
463  TString rpHoleName = Form("richProtectionHole%d",ia);
464 
465  lRichProtectionHole.at(ia) = new TGeoBBox(rpHoleName,
466  rpHoleWidth.at(ia),
467  rpHoleWidth.at(ia),
468  alBoxSize.Z()/2 );
469 
470  rpUnity = "( " + rpName + ":" + rpTransName + " ) - ( " + rpHoleName + " ) ";
471 
472  lRichProtection.at(ia) = new TGeoBBox(rpName,
473  aerogelSize.X()/2,
474  phDetY[1],
475  rpThickness/2 );
476  rpTrans.at(ia) = new TGeoTranslation(rpTransName,
477  aerogelOffset.X(),
478  aerogelOffset.Y(),
479  zrp);
480  rpTrans.at(ia)->RegisterYourself();
481  richProtectionCS.at(ia) = new TGeoCompositeShape(rpCSName,rpUnity);
482  richProtection.at(ia) = new TGeoVolume(richProtectionName,
483  richProtectionCS.at(ia),
484  med);
485  richProtection.at(ia)->SetLineColor(kCyan);
486  richProtection.at(ia)->SetTransparency(40);
487  alRichBoxAir->AddNode(richProtection.at(ia), 1, new TGeoCombiTrans( 0, 0, 0, new TGeoRotation(0) ) );
488  AddSensitiveVolume(richProtection.at(ia));
489 
490  zrp += rpThickness/2;
491  }
492  }
493 */
494 //-------------------------------------------------------------
495 
496  }
497  else {
502  FairGeoLoader* geoLoad = FairGeoLoader::Instance();
503  FairGeoInterface* geoFace = geoLoad->getGeoInterface();
504  PndRichGeo* Geo = new PndRichGeo();
505  Geo->setGeomFile(GetGeometryFileName());
506  geoFace->addGeoModule(Geo);
507 
508  Bool_t rc = geoFace->readSet(Geo);
509  if (rc) { Geo->create(geoLoad->getGeoBuilder()); }
510  TList* volList = Geo->getListOfVolumes();
511 
512  // store geo parameter
513  FairRun* fRun = FairRun::Instance();
514  FairRuntimeDb* rtdb= FairRun::Instance()->GetRuntimeDb();
515  PndRichGeoPar* par=(PndRichGeoPar*)(rtdb->getContainer("PndRichGeoPar"));
516  TObjArray* fSensNodes = par->GetGeoSensitiveNodes();
517  TObjArray* fPassNodes = par->GetGeoPassiveNodes();
518 
519  TListIter iter(volList);
520  FairGeoNode* node = NULL;
521  FairGeoVolume* aVol=NULL;
522 
523  while( (node = (FairGeoNode*)iter.Next()) ) {
524  aVol = dynamic_cast<FairGeoVolume*> ( node );
525  if ( node->isSensitive() ) {
526  fSensNodes->AddLast( aVol );
527  } else {
528  fPassNodes->AddLast( aVol );
529  }
530  }
531  par->setChanged();
532  par->setInputVersion(fRun->GetRunId(),1);
533 
534  ProcessNodes ( volList );
535  }
536 }
FairGeoLoader * geoLoad
Double_t par[3]
TObjArray * GetGeoSensitiveNodes()
Definition: PndRichGeoPar.h:26
FairRunAna * fRun
Definition: hit_dirc.C:58
TObjArray * GetGeoPassiveNodes()
Definition: PndRichGeoPar.h:27
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
FairGeoInterface * geoFace
void PndRich::ConstructOpGeometry ( )

Definition at line 540 of file PndRich.cxx.

References DefGeoVersion(), Double_t, fGeo, fGeoVersion, fnOpt, i, PndRichGeo::init(), lhcbaerindex(), PndRichGeo::nOpt(), and npoints.

540  {
541  cout<< " ==================================================== " << endl;
542  cout<< " ======= Rich:: ConstructOpticalGeometry() ======== " << endl;
543 
544  DefGeoVersion();
545  //PndRichGeo *fGeo = new PndRichGeo();
547 
548 
549  // Aerogel optical properties
550 
551  std::vector<Double_t> nOpt = fGeo->nOpt();
552  UInt_t nAerogelLayers = nOpt.size();
553  if (nOpt.size()>0) {
554  fnOpt = 0;
555  for(size_t i=0;i<nOpt.size();i++)
556  fnOpt += nOpt.at(i);
557  fnOpt /= nOpt.size();
558  }
559 
560  Int_t npoints = 10;
561 
562  Double_t ephotonMin = 1.240*1.0e-09; // 1000 nm - maximum of pde_dpc3200
563  Double_t ephotonMax = 4.428*1.0e-09; // 280 nm - minimum of pde_dpc3200
564  Double_t ephoton[npoints]; // Value of photon momentum (in GeV)
565 
566  Double_t absLen[npoints]; // absorption length in cm
567  Double_t qEff[npoints]; // Detection efficiency for UV photons
568  Double_t refInd[nAerogelLayers][npoints]; // Refraction index
569 
570  Double_t k = 2*3.1415927*197.3269602e-9; // coefficient energy to wavelength (hc)
571 
572  for(Int_t i=0; i<npoints; i++ ) {
573 
574  ephoton[i] = ephotonMin + i*(ephotonMax-ephotonMin)/(npoints-1);
575  Double_t wl = k/ephoton[i]; // wavelength in nm
576 
577  for(UInt_t l=0; l<nAerogelLayers; l++ )
578  refInd[l][i] = lhcbaerindex(nOpt[l],wl);
579 
580  absLen[i] = 4.5*std::pow(wl/400,4.0);
581  qEff[i] = 0.;
582  }
583 
584  cout << "fGeoVersion = " << fGeoVersion << endl;
585  cout << "nOpt.size() = " << nOpt.size() << endl;
586  for(size_t i=0;i<nOpt.size();i++) {
587 
588  //Int_t mId = gGeoManager->GetVolume( Form("RichAerogelSensor%d",i) )->GetMedium()->GetId();
589  Int_t mId = gMC->MediumId( Form("RichAerogel%d",(int)i) );
590 
591  gMC->SetCerenkov( mId, npoints, ephoton, absLen, qEff, refInd[i] );
592 
593  }
594 
595  // optical properties of air, photodetector window, mirror surface
596  Int_t npoints_i = 2;
597 
598  Double_t ephoton_i[npoints_i];
599  ephoton_i[0] = 1.240*1.0e-09; // 1 eV
600  ephoton_i[1] = 4.428*1.0e-09; // 10 eV
601 
602  Double_t reflectivity_i[npoints_i];
603  reflectivity_i[0] = 0.9;
604  reflectivity_i[1] = 0.9;
605 
606  Double_t abs_i[npoints_i];
607  abs_i[0] = 1000.;
608  abs_i[1] = 1000.;
609 
610  Double_t pdWindowRefInd[npoints_i];
611  pdWindowRefInd[0] = 1.46;
612  pdWindowRefInd[1] = 1.46;
613 
614  Double_t airRefInd[npoints_i];
615  airRefInd[0] = 1.0;
616  airRefInd[1] = 1.0;
617 
618  Double_t qEff_i[npoints_i];
619  qEff_i[0] = 0.;
620  qEff_i[1] = 0.;
621 
622  gMC->SetCerenkov( gMC->MediumId("RichAir"), npoints_i, ephoton_i, abs_i, qEff_i, airRefInd );
623  gMC->SetCerenkov( gMC->MediumId("RichPDWindow"), npoints_i, ephoton_i, abs_i, qEff_i, pdWindowRefInd );
624 
625  gMC->DefineOpSurface("RichMirrSurface", kGlisur, kDielectric_metal, kPolished, 0.0);
626  gMC->SetMaterialProperty("RichMirrSurface", "REFLECTIVITY", npoints_i, ephoton_i, reflectivity_i);
627  gMC->SetBorderSurface("BarRichMirrorSurface", "RichMirror", 1, "RichAlBoxAir", 1, "RichMirrSurface");
628  gMC->SetSkinSurface("RichAirMirrorSurface", "RichMirror", "RichMirrSurface");
629 
630 // gMC->SetBorderSurface("BarRichMirrorLeftSurface", "RichMirrorLeft", 1, "RichAlBoxAir", 1, "RichMirrSurface");
631 // gMC->SetSkinSurface("RichAirMirrorLeftSurface", "RichMirrorLeft", "RichMirrSurface");
632 // gMC->SetBorderSurface("BarRichMirrorRightSurface", "RichMirrorRight", 1, "RichAlBoxAir", 1, "RichMirrSurface");
633 // gMC->SetSkinSurface("RichAirMirrorRightSurface", "RichMirrorRight", "RichMirrSurface");
634 
635  cout<<" ======= RICH::ConstructOpGeometry -> Finished! ====== "<< endl;
636 
637 }
Int_t i
Definition: run_full.C:25
UInt_t fGeoVersion
Definition: PndRich.h:113
Double_t fnOpt
Definition: PndRich.h:130
Double_t
Double_t lhcbaerindex(Double_t n400, Double_t wl)
Definition: PndRich.cxx:645
void init(size_t ver=0)
Definition: PndRichGeo.cxx:82
void DefGeoVersion()
Definition: PndRich.cxx:349
std::vector< Double_t > nOpt()
Definition: PndRichGeo.h:132
PndRichGeo * fGeo
energy loss
Definition: PndRich.h:108
virtual void PndRich::CopyClones ( TClonesArray *  ,
TClonesArray *  ,
Int_t   
)
inlinevirtual

The following methods can be implemented if you need to make any optional action in your detector during the transport.

Definition at line 84 of file PndRich.h.

85  {;} //cl1 cl2 offset //[R.K.03/2017] unused variable(s)
void PndRich::DefGeoVersion ( )
private

Definition at line 349 of file PndRich.cxx.

References fGeoVersion, and TString.

Referenced by ConstructOpGeometry(), and Initialize().

350 {
351  TString fileName = GetGeometryFileName();
352  if( fileName.EndsWith(".root") && (fGeoVersion==313) ){
353  char pat[] = "rich_v";
354  size_t ind = fileName.Index(pat)+strlen(pat);
355  sscanf(fileName(ind,5).Data(),"%d",&fGeoVersion);
356  std::cout << "GetGeometryFileName() = " << fileName << " " << fGeoVersion << std::endl;
357  }
358 }
UInt_t fGeoVersion
Definition: PndRich.h:113
void PndRich::EndOfEvent ( )
virtual

Definition at line 342 of file PndRich.cxx.

References fPndRichBarPointCollection, fPndRichPDPointCollection, and trackid.

343 {
344  fPndRichPDPointCollection->Clear();
346  trackid.clear();
347 }
TClonesArray * fPndRichBarPointCollection
Definition: PndRich.h:118
std::map< Int_t, Int_t > trackid
Definition: PndRich.h:128
TClonesArray * fPndRichPDPointCollection
Definition: PndRich.h:117
virtual void PndRich::FinishPrimary ( )
inlinevirtual

Definition at line 88 of file PndRich.h.

88 {;}
void PndRich::FinishRun ( )
virtual

Definition at line 291 of file PndRich.cxx.

292 {
293 // C->Delete();
294 // H->Delete();
295 // B->Delete();
296 // B10->Delete();
297 // B11->Delete();
298 // matRcihProt->Delete();
299 // med->Delete();
300 }
TClonesArray * PndRich::GetCollection ( Int_t  iColl) const
virtual

Gets the produced collections

Definition at line 378 of file PndRich.cxx.

References fPndRichBarPointCollection, and fPndRichPDPointCollection.

379 {
380  if (iColl == 0) return fPndRichPDPointCollection;
381  if (iColl == 1) return fPndRichBarPointCollection;
382  return NULL;
383 }
TClonesArray * fPndRichBarPointCollection
Definition: PndRich.h:118
TClonesArray * fPndRichPDPointCollection
Definition: PndRich.h:117
void PndRich::Initialize ( )
virtual

Initialization of the detector is done here

Definition at line 106 of file PndRich.cxx.

References PndRichGeo::aerogelOffset(), PndRichGeo::aerogelSize(), PndGeoHandling::CreateUniqueSensorId(), DefGeoVersion(), Double_t, fGeo, fGeoH, fGeoVersion, fListOfSensitives, fnOpt, fPDE, fRun, fRunCherenkov, fWlPhoton, fZabar, gGeoManager, i, PndRichGeo::init(), Initialize(), PndRichGeo::nOpt(), par, PndGeoHandling::PrintSensorNames(), PndRichGeo::richOffset(), rtdb, and trackid.

107 {
109  FairRun* fRun = FairRun::Instance();
110  FairRuntimeDb* rtdb= FairRun::Instance()->GetRuntimeDb();
111  PndRichGeoPar* par=(PndRichGeoPar*)(rtdb->getContainer("PndRichGeoPar"));
112  par->setChanged();
113  par->setInputVersion(fRun->GetRunId(),1);
114 
115  if (0==gGeoManager)
116  cout << "We do not have gGeoManager" << endl;
117  else
118  cout << "there is gGeoManager" << endl;
119 
120  cout << "list of sensitives has " << fListOfSensitives.size() << " entries" << endl;
122  if(fVerboseLevel>0) fGeoH->PrintSensorNames();
123  trackid.clear();
124 
125  if (fRunCherenkov==kFALSE) cout << " -I- PndRich: Switching OFF Cherenkov Propagation" << endl;
126 
127  // define geometry version from name of geometry file
128  DefGeoVersion();
129 
130  // average refractive index of aerogel
132  std::vector<Double_t> nopt = fGeo->nOpt();
133  if (nopt.size()>0) {
134  fnOpt = 0;
135  for(size_t i=0;i<nopt.size();i++)
136  fnOpt += nopt.at(i);
137  fnOpt /= nopt.size();
138  std::cout << "Mid ref. index = " << fnOpt << std::endl;
139  }
140 
141  // aerogel bar entrance z coordinate
142  TVector3 richOffset = fGeo->richOffset();
143  TVector3 aerogelOffset = fGeo->aerogelOffset();
144  TVector3 aerogelSize = fGeo->aerogelSize();
145  fZabar = richOffset.Z() + aerogelOffset.Z();
146 
147  // pde_dpc3200_22.dat
148  std::string workdir(getenv( "VMCWORKDIR" ));
149  std::string effFileName(workdir+"/detectors/rich/pde_dpc3200_22.dat");
150  std::ifstream from( effFileName.c_str() );
151  Double_t wli, pdei;
152  from >> wli >> pdei;
153  while( !from.eof() ) {
154  fWlPhoton.push_back(wli); // nm
155  fPDE.push_back(pdei); // %
156  from >> wli >> pdei;
157  };
158 
159 }
PndGeoHandling * fGeoH
Definition: PndRich.h:109
TVector3 aerogelOffset()
Definition: PndRichGeo.h:129
Int_t i
Definition: run_full.C:25
UInt_t fGeoVersion
Definition: PndRich.h:113
TVector3 aerogelSize()
Definition: PndRichGeo.h:126
void CreateUniqueSensorId(TString startName, std::vector< std::string > listOfSensitives)
Has to be called during simulation to create unique sensor id.
Double_t par[3]
Double_t fnOpt
Definition: PndRich.h:130
TGeoManager * gGeoManager
std::map< Int_t, Int_t > trackid
Definition: PndRich.h:128
FairRunAna * fRun
Definition: hit_dirc.C:58
std::vector< Double_t > fWlPhoton
Definition: PndRich.h:125
Bool_t fRunCherenkov
Definition: PndRich.h:112
void PrintSensorNames()
Double_t
std::vector< std::string > fListOfSensitives
Definition: PndRich.h:58
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
void init(size_t ver=0)
Definition: PndRichGeo.cxx:82
Double_t fZabar
Definition: PndRich.h:131
TVector3 richOffset()
Definition: PndRichGeo.h:117
void DefGeoVersion()
Definition: PndRich.cxx:349
std::vector< Double_t > nOpt()
Definition: PndRichGeo.h:132
Mvd Initialize()
PndRichGeo * fGeo
energy loss
Definition: PndRich.h:108
std::vector< Double_t > fPDE
Definition: PndRich.h:126
Double_t PndRich::lhcbaerindex ( Double_t  n400,
Double_t  wl 
)

Definition at line 645 of file PndRich.cxx.

References sqrt().

Referenced by ConstructOpGeometry().

646 {
647  const double LHCb_a0=0.05639, LHCb_wl0sqr = 83.22*83.22;
648  double LHCb_RI2m1ref = LHCb_a0/(1-LHCb_wl0sqr/(400*400)); //(n**2-1) of LHCb aerogel at 400nm
649  double ri2m1_lhcb = LHCb_a0/(1-LHCb_wl0sqr/(wl*wl)); //(n**2-1) of LHCb aerogel at wl
650  return sqrt( 1 + (n400*n400-1)/LHCb_RI2m1ref*ri2m1_lhcb );
651 }
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
PndRich& PndRich::operator= ( const PndRich )
private
virtual void PndRich::PostTrack ( )
inlinevirtual

Definition at line 91 of file PndRich.h.

91 {;}
virtual void PndRich::PreTrack ( )
inlinevirtual

Definition at line 92 of file PndRich.h.

92 {;}
Bool_t PndRich::ProcessHits ( FairVolume *  v = 0)
virtual

this method is called for each step during simulation (see FairMCApplication::Stepping())

This method is called from the MC stepping

Definition at line 161 of file PndRich.cxx.

References AddBarPoint(), AddPDPoint(), PndStack::AddPoint(), Double_t, fELoss, fGeo, fLength, fMom, fnOpt, fPos, fRunCherenkov, fTime, fTrackID, fVolumeID, fZabar, kRICH, nam, particle, PndRichGeo::phDetQEff(), trackid, and TString.

162 {
164  TString nam =vol->GetName();
165  //Int_t num = vol->getMCid(); //[R.K. 01/2017] unused variable?
166 
167  //Set parameters at entrance of volume. Reset ELoss.
168  Int_t fEventID = gMC->CurrentEvent();
169  Int_t fPdgCode = gMC->TrackPid();
170  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
171  fTime = gMC->TrackTime() * 1.0e09;
172  fLength = gMC->TrackLength();
173 
174 /* //Get current material
175  //if ( nam.BeginsWith("RichPhDetSi") ) {
176  if ( nam.BeginsWith("RichProtection") ) {
177  //if ( nam.BeginsWith("RichAerogel") ) {
178  Float_t a, z, dens, radl, absl;
179  Int_t mat = gMC->CurrentMaterial(a,z,dens,radl,absl);
180  cout<< nam << " " << mat << endl;
181  cout<<"a = " << a << " z = " << z << " dens = " << dens << " radl = " << radl << " absl = " << absl << endl;
182 
183  cout<< ">>>>>>>>>>>>>> " <<gGeoManager->GetVolume(vol->getVolumeId())->GetName() <<endl;
184 
185  TGeoMaterial *material = gGeoManager->GetVolume(vol->getVolumeId())->GetMaterial();
186  //TGeoMaterial *material = gGeoManager->GetMaterial(mat);
187  //TGeoMaterial *material = gGeoManager->GetMaterial("RichProtection");
188  //TGeoMaterial *material = gGeoManager->GetMaterial("silicon");
189  //TGeoMaterial *material = gGeoManager->GetMaterial("RichAerogel0");
190  cout<< material->GetName() << endl;
191  Int_t nels = material->GetNelements();
192  for(Int_t i=0; i<nels; i++){
193  TGeoElement *element = material->GetElement(i);
194  cout << element->GetName() << endl;
195  Int_t nis = element->GetNisotopes();
196  cout << "element->GetNisotopes() = " << nis << endl;
197  cout << "element->A() = " << element->A()
198  << " element->Z() = " << element->Z()
199  << " element->N() = " << element->N() << endl;
200  for(Int_t j=0; j<nis; j++){
201  TGeoIsotope *isotope = element->GetIsotope(j);
202  cout << "Isotope: " << j << " " << isotope->GetName()
203  << " a=" << isotope->GetA()
204  << " z=" << isotope->GetZ()
205  << " n=" << isotope->GetN() << endl;
206  }
207  }
208  }
209  if ( nam.BeginsWith("RichAerogel") || nam.BeginsWith("RichPhDetSi")) {
210  TGeoMaterial *material = gGeoManager->GetVolume(vol->getVolumeId()-1)->GetMaterial();
211  //cout << nam << " " << "material->GetName() = " << material->GetName() << endl;
212  if ( strncmp( material->GetName(), "RichAerogel", strlen("RichAerogel") ) == 0 ) {
213  TObject *cherprop = material->GetCerenkovProperties();
214  //cout << material->GetName() << " " << cherprop << endl;
215  //cout << "cherprop->GetName() = " << cherprop->GetName() << endl;
216  }
217 
218  //TList *listOfMedia = gGeoManager->GetListOfMedia();
219  //TListIter iter(listOfMedia);
220  //TGeoMedium* medium = NULL;
221 
222  //while( (medium = (TGeoMedium*)iter.Next()) ) {
223  // cout << "medium->GetName() = " << medium->GetName() << endl;
224  //}
225  }
226  //TGeoVolume *RichProtection = gGeoManager->GetVolume("RichProtectionSensor0");
227  //cout << "RichProtection = " << RichProtection
228  // << " RichProtection->IsActive() = " << RichProtection->IsActive()
229  // << " nam.BeginsWith() = " << nam.BeginsWith("RichProtection") << endl;
230 */
231  gMC->TrackPosition(fPos);
232  gMC->TrackMomentum(fMom);
233 
234  // Create PndRichPoint at exit of active volume
235  if ( fPdgCode == 50000050 ) {
236  // Efficiency of photodetector
237  Double_t eff = fGeo->phDetQEff(2*3.1415927*197.3269602e-9/fMom.Vect().Mag());
238  if (fRunCherenkov==kFALSE ) {
239  if (fVerboseLevel >0) cout<< "Photon killed" << endl;
240  gMC->StopTrack();
241  }
242  else if ( nam.BeginsWith("RichPhDetSi") && (gMC->IsTrackEntering()==1) && (gRandom->Uniform()<eff) ){
243  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
244  fVolumeID = vol->getMCid();
245  AddPDPoint(fTrackID, fVolumeID, fPos.Vect(), fMom.Vect(),
246  fTime, fLength, fELoss, fEventID);
247 
248  // Increment number of PndRich det points in TParticle
249  PndStack* stack = (PndStack*) gMC->GetStack();
250  stack->AddPoint(kRICH);
251  gMC->StopTrack();
252  }
253  }
254 
255  if( (gMC->TrackCharge() != 0) && (fMom.Beta() > 1.00/fnOpt) &&
256  gMC->IsTrackEntering()==1 && (fPos.Z() < fZabar+0.001) &&
257  (nam.BeginsWith("RichAerogel")) && (trackid[fTrackID] != 1) ){
258 
259  trackid[fTrackID] = 1; // register new track
260 
261  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
262  fVolumeID = vol->getMCid();
263  Double_t fMass = gMC->TrackMass();
264 
265  Double_t fThetaC = 1/fnOpt/fMom.Beta(); // Cerenkov angle
266  fThetaC = fMom.Beta(); // beta
267 
268  TParticle *particle = gMC->GetStack()->GetCurrentTrack();
269  TVector3 pos0 = TVector3(particle->Vx(),particle->Vy(),particle->Vz());
270  TVector3 mom0 = TVector3(particle->Px(),particle->Py(),particle->Pz());
271 
272  AddBarPoint(fTrackID, fVolumeID, fPos.Vect(), fMom.Vect(),
273  fTime, fLength, fPdgCode, fThetaC, fEventID, fMass,
274  pos0, mom0);
275 
276 // TParticle *particle = gMC->GetStack()->GetCurrentTrack();
277 // cout << "particle: " << particle->Vx() << " "
278 // << particle->Vy() << " " << particle->Vz() << " "
279 // << particle->T() << " "
280 // << particle->Theta() << " " << particle->Phi() << " "
281 // << particle->Px() << " " << particle->Py() << " "
282 // << particle->Pz() << " " << particle->P() <<
283 // endl;
284 
285  }
286 
287 
288  return kTRUE;
289 }
Double_t phDetQEff(Double_t wl)
Definition: PndRichGeo.cxx:531
TLorentzVector fMom
position at entrance
Definition: PndRich.h:103
Double_t fLength
time
Definition: PndRich.h:105
Double_t fTime
momentum at entrance
Definition: PndRich.h:104
PndRichPDPoint * AddPDPoint(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, UInt_t EventId=0)
Definition: PndRich.cxx:664
Double_t fnOpt
Definition: PndRich.h:130
TLorentzVector fPos
volume id
Definition: PndRich.h:102
std::map< Int_t, Int_t > trackid
Definition: PndRich.h:128
void AddPoint(DetectorId iDet)
Definition: PndStack.cxx:408
const int particle
Bool_t fRunCherenkov
Definition: PndRich.h:112
Double_t
Double_t fELoss
length
Definition: PndRich.h:106
Double_t fZabar
Definition: PndRich.h:131
PndRichBarPoint * AddBarPoint(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Int_t pdgCode, Double_t thetaC, Int_t eventID, Double_t mass, TVector3 pos0, TVector3 mom0)
Definition: PndRich.cxx:675
Int_t fVolumeID
track index
Definition: PndRich.h:101
Int_t fTrackID
Definition: PndRich.h:100
TString nam
Definition: sim_hypGe.C:48
PndRichGeo * fGeo
energy loss
Definition: PndRich.h:108
void PndRich::Register ( )
virtual

Registers the produced collections in FAIRRootManager.

This will create a branch in the output tree called PndRichPoint, setting the last parameter to kFALSE means: this collection will not be written to the file, it will exist only during the simulation.

Definition at line 360 of file PndRich.cxx.

References fPndRichBarPointCollection, fPndRichPDPointCollection, and fRunCherenkov.

361 {
362 
369  if (fRunCherenkov==kTRUE)
370  FairRootManager::Instance()->Register("RichPDPoint", "PndRich",
372  FairRootManager::Instance()->Register("RichBarPoint", "PndRich",
374 
375 }
TClonesArray * fPndRichBarPointCollection
Definition: PndRich.h:118
Bool_t fRunCherenkov
Definition: PndRich.h:112
TClonesArray * fPndRichPDPointCollection
Definition: PndRich.h:117
void PndRich::Reset ( )
virtual

has to be called after each event to reset the containers

Definition at line 385 of file PndRich.cxx.

References fPndRichBarPointCollection, and fPndRichPDPointCollection.

386 {
387  fPndRichPDPointCollection->Clear();
389 }
TClonesArray * fPndRichBarPointCollection
Definition: PndRich.h:118
TClonesArray * fPndRichPDPointCollection
Definition: PndRich.h:117
void PndRich::SetGeoVersion ( UInt_t const &  version)
inline

Definition at line 56 of file PndRich.h.

References fGeoVersion.

56 { fGeoVersion = version; };
UInt_t fGeoVersion
Definition: PndRich.h:113
void PndRich::SetRunCherenkov ( Bool_t const &  ch)
inline

Definition at line 54 of file PndRich.h.

References fRunCherenkov.

Referenced by sim_complete_runs(), and sim_rich().

54 { fRunCherenkov = ch; };
Bool_t fRunCherenkov
Definition: PndRich.h:112
virtual void PndRich::SetSpecialPhysicsCuts ( )
inlinevirtual

Definition at line 86 of file PndRich.h.

86 {;}
void PndRich::UseProtection ( Bool_t const &  up)
inline

Definition at line 58 of file PndRich.h.

References fUseProtection.

58 { fUseProtection = up; };
Bool_t fUseProtection
///&lt; converter for detector names
Definition: PndRich.h:111

Member Data Documentation

Double_t PndRich::fELoss
private

length

Definition at line 106 of file PndRich.h.

Referenced by ProcessHits().

PndRichGeo* PndRich::fGeo
private

energy loss

Definition at line 108 of file PndRich.h.

Referenced by ConstructOpGeometry(), Initialize(), and ProcessHits().

PndGeoHandling* PndRich::fGeoH
private

Definition at line 109 of file PndRich.h.

Referenced by Initialize(), and PndRich().

UInt_t PndRich::fGeoVersion
private

Definition at line 113 of file PndRich.h.

Referenced by ConstructOpGeometry(), DefGeoVersion(), Initialize(), PndRich(), and SetGeoVersion().

Double_t PndRich::fLength
private

time

Definition at line 105 of file PndRich.h.

Referenced by ProcessHits().

std::vector<std::string> PndRich::fListOfSensitives

Definition at line 58 of file PndRich.h.

Referenced by CheckIfSensitive(), Initialize(), and PndRich().

TLorentzVector PndRich::fMom
private

position at entrance

Definition at line 103 of file PndRich.h.

Referenced by ProcessHits().

Double_t PndRich::fnOpt
private

Definition at line 130 of file PndRich.h.

Referenced by ConstructOpGeometry(), Initialize(), and ProcessHits().

std::vector<Double_t> PndRich::fPDE
private

Definition at line 126 of file PndRich.h.

Referenced by Initialize().

TClonesArray* PndRich::fPndRichBarPointCollection
private

Definition at line 118 of file PndRich.h.

Referenced by AddBarPoint(), EndOfEvent(), GetCollection(), Register(), Reset(), and ~PndRich().

TClonesArray* PndRich::fPndRichPDPointCollection
private

container for data points

Definition at line 117 of file PndRich.h.

Referenced by AddPDPoint(), EndOfEvent(), GetCollection(), Register(), Reset(), and ~PndRich().

TLorentzVector PndRich::fPos
private

volume id

Definition at line 102 of file PndRich.h.

Referenced by ProcessHits().

Bool_t PndRich::fRunCherenkov
private

Definition at line 112 of file PndRich.h.

Referenced by Initialize(), ProcessHits(), Register(), and SetRunCherenkov().

Double_t PndRich::fTime
private

momentum at entrance

Definition at line 104 of file PndRich.h.

Referenced by ProcessHits().

Int_t PndRich::fTrackID
private
Track information to be stored until the track leaves the

active volume.

Definition at line 100 of file PndRich.h.

Referenced by ProcessHits().

Bool_t PndRich::fUseProtection
private

///< converter for detector names

Definition at line 111 of file PndRich.h.

Referenced by UseProtection().

Int_t PndRich::fVolumeID
private

track index

Definition at line 101 of file PndRich.h.

Referenced by ProcessHits().

std::vector<Double_t> PndRich::fWlPhoton
private

Definition at line 125 of file PndRich.h.

Referenced by Initialize().

Double_t PndRich::fZabar
private

Definition at line 131 of file PndRich.h.

Referenced by Initialize(), and ProcessHits().

std::map<Int_t,Int_t> PndRich::trackid
private

Definition at line 128 of file PndRich.h.

Referenced by EndOfEvent(), Initialize(), and ProcessHits().


The documentation for this class was generated from the following files: