FairRoot/PandaRoot
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes | List of all members
PndEmcMapper Class Reference

Emc geometry mapper. More...

#include <PndEmcMapper.h>

Inheritance diagram for PndEmcMapper:
PndEmcMapperGeo12Dat PndEmcMapperGeo12Root PndEmcMapperGeo3Dat PndEmcMapperGeo3Root PndEmcMapperGeo3RootV2 PndEmcMapperGeo4Dat PndEmcMapperGeo4Root PndEmcMapperGeo4RootV2 PndEmcMapperGeo5Dat PndEmcMapperGeo5Root PndEmcMapperGeo6Dat PndEmcMapperGeoProto60Root

Public Member Functions

const std::map< Int_t,
PndEmcTwoCoordIndex * > & 
GetTciMap ()
 
virtual ~PndEmcMapper ()
 
Int_t GetMapVersion () const
 
void Add (PndEmcMapper *)
 
PndEmcTwoCoordIndexGetTCI (Int_t DetectorId)
 

Static Public Member Functions

static PndEmcMapperInstance ()
 
static void Init (Int_t MapVersion)
 

Protected Member Functions

 PndEmcMapper ()
 

Protected Attributes

std::map< Int_t,
PndEmcTwoCoordIndex * > 
fIntTwoCoordMap
 

Private Member Functions

Int_t GetDetId (Int_t iTheta, Int_t iPhi)
 

Static Private Attributes

static PndEmcMapper_instance = 0
 
static Int_t fMapVersion = 0
 

Detailed Description

Emc geometry mapper.

Definition at line 22 of file PndEmcMapper.h.

Constructor & Destructor Documentation

PndEmcMapper::~PndEmcMapper ( )
virtual

Destructor

Definition at line 97 of file PndEmcMapper.cxx.

References _instance, and fIntTwoCoordMap.

98 {
99  delete _instance;
100  for(std::map<Int_t,PndEmcTwoCoordIndex* >::iterator iter = fIntTwoCoordMap.begin();
101  iter != fIntTwoCoordMap.end(); ++iter){
102  delete (*iter).second;
103  }
104  fIntTwoCoordMap.clear();
105 }
std::map< Int_t, PndEmcTwoCoordIndex * > fIntTwoCoordMap
Definition: PndEmcMapper.h:40
static PndEmcMapper * _instance
Definition: PndEmcMapper.h:44
PndEmcMapper::PndEmcMapper ( )
protected

Definition at line 22 of file PndEmcMapper.cxx.

22  : fIntTwoCoordMap()
23 {
24 }
std::map< Int_t, PndEmcTwoCoordIndex * > fIntTwoCoordMap
Definition: PndEmcMapper.h:40

Member Function Documentation

void PndEmcMapper::Add ( PndEmcMapper newMapper)

Definition at line 89 of file PndEmcMapper.cxx.

References fIntTwoCoordMap, and GetTciMap().

Referenced by Init().

90 {
91  std::map<Int_t,PndEmcTwoCoordIndex* > newMapp = newMapper->GetTciMap();
92 
93  fIntTwoCoordMap.insert(newMapp.begin(),newMapp.end());
94 }
const std::map< Int_t, PndEmcTwoCoordIndex * > & GetTciMap()
std::map< Int_t, PndEmcTwoCoordIndex * > fIntTwoCoordMap
Definition: PndEmcMapper.h:40
Int_t PndEmcMapper::GetDetId ( Int_t  iTheta,
Int_t  iPhi 
)
private

Definition at line 446 of file PndEmcMapper.cxx.

References row.

447 {
448  Int_t module,row,copy,crystal,detId;
449  module = row = copy = crystal = detId = 0;
450  if (iTheta<=29)
451  {
452  module=2;
453  row=30-iTheta;
454  copy=(iPhi-1)/10+1;
455  crystal=10 - (iPhi-1)%10;
456  }
457  else if ((iTheta>29)&&(iTheta<73))
458  {
459  module=1;
460  row=iTheta-29;
461  copy=(iPhi-1)/10+1;
462  crystal=10 - (iPhi-1)%10;
463  }
464 
466  if (iTheta>200 && iTheta<300)
467  {
468  module=3;
469  copy = 0;
470  if (iTheta<250 && iPhi>=250) {
471  row = (iPhi-250)+1+37;
472  crystal = -(iTheta-250)+36;
473  }
474  else if (iTheta<250 && iPhi<250) {
475  row = (iPhi-250)+37;
476  crystal = -(iTheta-250)+36;
477  }
478  else if (iTheta>=250 && iPhi>=250) {
479  row = (iPhi-250)+1+37;
480  crystal = -(iTheta-250+1)+36;
481  }
482  else if (iTheta>=250 && iPhi<250) {
483  row = (iPhi-250)+37;
484  crystal = -(iTheta-250+1)+36;
485  }
486  }
488 
489  if ((iTheta>300)&&(iTheta<400))
490  {
491  module=4;
492  if ((iTheta<=350)&& (iPhi>350))
493  {
494  copy = 1; row = 1-(iTheta-350); crystal = iPhi-350;
495  }
496  if ((iTheta<=350)&& (iPhi<=350))
497  {
498  copy = 2; row = 1-(iTheta-350); crystal = 1-(iPhi-350);
499  }
500  if ((iTheta>350)&& (iPhi<=350))
501  {
502  copy = 3; row = (iTheta-350); crystal = 1-(iPhi-350);
503  }
504  if ((iTheta>350)&& (iPhi>350))
505  {
506  copy = 4; row = (iTheta-350); crystal = iPhi-350;
507  }
508  }
509  if ((iTheta>400)&&(iTheta<500))
510  {
511  module=5;
512  if ((iTheta<=450)&& (iPhi>450))
513  {
514  copy = 1; row = 1-(iTheta-450); crystal = iPhi-450;
515  }
516  if ((iTheta<=450)&& (iPhi<=450))
517  {
518  copy = 2; row = 1-(iTheta-450); crystal = 1-(iPhi-450);
519  }
520  if ((iTheta>450)&& (iPhi<=450))
521  {
522  copy = 3; row = (iTheta-450); crystal = 1-(iPhi-450);
523  }
524  if ((iTheta>450)&& (iPhi>450))
525  {
526  copy = 4; row = (iTheta-450); crystal = iPhi-450;
527  }
528  }
529  if ((iTheta>500)&&(iTheta<600))
530  {
531  module=6;
532  copy = 1;
533  row = iTheta-550;
534  crystal = iPhi-550;
535  }
536 
537  detId = module*100000000 + row*1000000 + copy*10000 + crystal;
538 
539  return detId;
540 }
int row
Definition: anaLmdDigi.C:67
Int_t PndEmcMapper::GetMapVersion ( ) const
inline

Accessors

Definition at line 34 of file PndEmcMapper.h.

References fMapVersion.

34 { return fMapVersion ;};
static Int_t fMapVersion
Definition: PndEmcMapper.h:45
PndEmcTwoCoordIndex * PndEmcMapper::GetTCI ( Int_t  DetectorId)
const std::map< Int_t, PndEmcTwoCoordIndex * > & PndEmcMapper::GetTciMap ( )

Definition at line 441 of file PndEmcMapper.cxx.

References fIntTwoCoordMap.

Referenced by Add(), and PndEmcHitsToWaveform::Exec().

442 {
443  return fIntTwoCoordMap;
444 }
std::map< Int_t, PndEmcTwoCoordIndex * > fIntTwoCoordMap
Definition: PndEmcMapper.h:40
PndEmcMapper::Init ( Int_t  MapVersion)
static

Definition at line 25 of file PndEmcMapper.cxx.

References _instance, Add(), and fMapVersion.

Referenced by anaPatternRecoQuality(), clonemc(), dbuilder(), generatePatternDB(), PndEmcGeoPar::InitEmcMapper(), kfparticle(), patternMatcher(), pid(), pid2_complete(), pid_box(), pid_complete(), pid_complete_runs(), pid_complete_sec(), pid_day1(), pid_multi(), pid_rich(), pidideal_complete(), pidideal_day1(), prod_pid(), prod_rec(), reco(), reco2_complete(), reco_box(), reco_complete(), reco_complete_gf2(), reco_complete_runs(), reco_complete_sec(), reco_completeCA(), reco_day1(), reco_fts(), reco_multi(), reco_rich(), reco_sttcombi(), recoideal_box(), recoideal_complete(), recoideal_day1(), recolocal_complete(), recoqa_complete(), run_reco_complete(), run_reco_sttcombi_timebased(), run_tracking_sttcombi_timebased(), runTrackingPid(), testFilter(), trackingQA_complete(), trackingQA_forward_complete(), and trackingQANewLinks().

26 {
27  if (mapVersion==0)
28  {
29  cout<<"Emc mapper version 0 does not exist"<<endl;
30  }
31  else if (mapVersion!=fMapVersion)
32  {
33  fMapVersion=mapVersion;
34  switch (mapVersion) {
35  case 1:
40  break;
41  case 2:
46  break;
47  case 3:
52  break;
53  case 4:
55  break;
56  case 5:
58  break;
59  case 6:
61  break;
62  case 7:
64  break;
65  case 8: // old backward emc mappping (geom. version 2008)
67  break;
68  case 9: // old barrel emc mapping
73  break;
74  default :
75  cout<<"Emc Mapper version "<<mapVersion<<" is not defined"<<endl;
76  }
77  }
78 }
static Int_t fMapVersion
Definition: PndEmcMapper.h:45
void Add(PndEmcMapper *)
static PndEmcMapper * _instance
Definition: PndEmcMapper.h:44
PndEmcMapper::Instance ( )
static

Member Data Documentation

PndEmcMapper * PndEmcMapper::_instance = 0
staticprivate

Definition at line 44 of file PndEmcMapper.h.

Referenced by Init(), Instance(), and ~PndEmcMapper().

std::map<Int_t,PndEmcTwoCoordIndex* > PndEmcMapper::fIntTwoCoordMap
protected
Int_t PndEmcMapper::fMapVersion = 0
staticprivate

Definition at line 45 of file PndEmcMapper.h.

Referenced by GetMapVersion(), and Init().


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