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

#include <PndMvdBoxMap.h>

Inheritance diagram for PndMvdBoxMap:

Public Member Functions

 PndMvdBoxMap ()
 
 PndMvdBoxMap (TString nome)
 
 ~PndMvdBoxMap ()
 
void Print ()
 
void SetMappingFile (TString nome)
 
Bool_t Init ()
 
void DoMapping (Int_t nbox, Int_t chan, TString &detpath)
 
void PrintMap ()
 

Private Member Functions

 ClassDef (PndMvdBoxMap, 1)
 

Private Attributes

std::map< Int_t, Int_t > box
 
std::map< Int_t, Int_t > fCh
 
std::map< Int_t, Int_t > lCh
 
std::map< Int_t, TStringfMap
 
TString fFileName
 
Int_t nLines
 

Detailed Description

Definition at line 17 of file PndMvdBoxMap.h.

Constructor & Destructor Documentation

PndMvdBoxMap::PndMvdBoxMap ( )
inline

Definition at line 20 of file PndMvdBoxMap.h.

20  :
21  box(),
22  fCh(),
23  lCh(),
24  fMap(),
25  fFileName(""),
26  nLines(0)
27  {};
std::map< Int_t, Int_t > box
Definition: PndMvdBoxMap.h:61
std::map< Int_t, TString > fMap
Definition: PndMvdBoxMap.h:65
std::map< Int_t, Int_t > fCh
Definition: PndMvdBoxMap.h:62
TString fFileName
Definition: PndMvdBoxMap.h:67
std::map< Int_t, Int_t > lCh
Definition: PndMvdBoxMap.h:63
PndMvdBoxMap::PndMvdBoxMap ( TString  nome)
inline

Definition at line 28 of file PndMvdBoxMap.h.

References SetMappingFile().

28  :
29  box(),
30  fCh(),
31  lCh(),
32  fMap(),
33  fFileName(""),
34  nLines(0)
35  {SetMappingFile(nome);};
std::map< Int_t, Int_t > box
Definition: PndMvdBoxMap.h:61
std::map< Int_t, TString > fMap
Definition: PndMvdBoxMap.h:65
void SetMappingFile(TString nome)
Definition: PndMvdBoxMap.h:43
std::map< Int_t, Int_t > fCh
Definition: PndMvdBoxMap.h:62
TString fFileName
Definition: PndMvdBoxMap.h:67
std::map< Int_t, Int_t > lCh
Definition: PndMvdBoxMap.h:63
PndMvdBoxMap::~PndMvdBoxMap ( )
inline

Definition at line 37 of file PndMvdBoxMap.h.

37 {};

Member Function Documentation

PndMvdBoxMap::ClassDef ( PndMvdBoxMap  ,
 
)
private
void PndMvdBoxMap::DoMapping ( Int_t  nbox,
Int_t  chan,
TString detpath 
)

Definition at line 98 of file PndMvdBoxMap.cxx.

References jj.

Referenced by PndMvdConvertApvTask::Exec().

99 {
100 
101  //Int_t sat = -1; //[R.K.02/2017] Unused variable?
102 
103  for (Int_t jj = 0 ; jj < nLines ; jj++)
104  {
105  if (nbox == box[jj])
106  {
107  if ( chan >= fCh[jj] && chan <= lCh[jj] )
108  {
109  detpath = fMap[jj];
110  //sat = jj; //[R.K.02/2017] Unused variable?
111  }
112  }
113  }
114 
115  // for debug...
116  // cout << "Box: " << nbox << ", ch: " << chan << " --> line: " << sat << ", name: " << detpath.Data() << endl;
117 
118  return;
119 }
std::map< Int_t, Int_t > box
Definition: PndMvdBoxMap.h:61
std::map< Int_t, TString > fMap
Definition: PndMvdBoxMap.h:65
std::map< Int_t, Int_t > fCh
Definition: PndMvdBoxMap.h:62
std::map< Int_t, Int_t > lCh
Definition: PndMvdBoxMap.h:63
Bool_t PndMvdBoxMap::Init ( )

Definition at line 19 of file PndMvdBoxMap.cxx.

References TString.

Referenced by PndMvdConvertApvTask::Init().

20 {
21  ifstream mapfile(fFileName.Data(),ifstream::in);
22 
23  Int_t fbox=-1, fchanMin=-1, fchanMax=-1;
24  nLines = 0;
25  TString detPathName;
26 
27  if (!mapfile.is_open()){
28  // abort on wrong file
29  Error("Init","Could not open file %s",fFileName.Data());
30  return kFALSE;
31  }
32 
33  /*box = new Int_t();
34  fCh = new Int_t();
35  lCh = new Int_t();*/
36  while(mapfile.good())
37  {
38  mapfile >> fbox >> fchanMin >> fchanMax >> detPathName;
39  if(mapfile.eof()) break;
40  cout << "Position: " << mapfile.tellg() << endl;
41  Info("Init","Read line: %i %i %i %s",fbox,fchanMin,fchanMax,detPathName.Data());
42  box[nLines] = fbox;
43  fCh[nLines] = fchanMin;
44  lCh[nLines] = fchanMax;
45 
46  fMap[nLines] = detPathName;
47 
48  // TString *name = new TString(detPathName);
49 // name.push_back(detPathName.Data());
50  //*name[nLines] = detPathName.Data();
51 
52  nLines++;
53  }
54 
55  cout << nLines << " entries" << endl;
56 
57 /* mapfile.clear();
58  mapfile.seekg(ios::beg);
59 
60 
61  Int_t buffNum;
62  TString buffName;
63 
64  for (Int_t zz = 0 ; zz < nLines ; zz++)
65  {
66 
67  mapfile >> buffNum;
68  box[zz] = buffNum;
69  mapfile >> buffNum;
70  fCh[zz] = buffNum;
71  mapfile >> buffNum;
72  lCh[zz] = buffNum;
73  mapfile >> buffName;
74  name[zz] = buffName;
75 
76  if(mapfile.eof()) break;
77  }
78 */
79 
80 //std::pair<Int_t,TString> apair(sw,detPathName);
81 //fApvNumberMap[rw] = apair;
82 
83  mapfile.close();
84  return kTRUE;
85 }
std::map< Int_t, Int_t > box
Definition: PndMvdBoxMap.h:61
std::map< Int_t, TString > fMap
Definition: PndMvdBoxMap.h:65
std::map< Int_t, Int_t > fCh
Definition: PndMvdBoxMap.h:62
TString fFileName
Definition: PndMvdBoxMap.h:67
std::map< Int_t, Int_t > lCh
Definition: PndMvdBoxMap.h:63
void PndMvdBoxMap::Print ( )

Definition at line 12 of file PndMvdBoxMap.cxx.

13 {
14  Info("Print","Filename = %s",fFileName.Data());
15  return;
16 }
TString fFileName
Definition: PndMvdBoxMap.h:67
void PndMvdBoxMap::PrintMap ( )

Definition at line 87 of file PndMvdBoxMap.cxx.

References jj.

88 {
89 
90  for (Int_t jj = 0 ; jj < nLines ; jj++)
91  {
92  cout << box[jj] << " " << fCh[jj] << " " << lCh[jj] << " " << fMap[jj] << endl;
93  }
94 }
std::map< Int_t, Int_t > box
Definition: PndMvdBoxMap.h:61
std::map< Int_t, TString > fMap
Definition: PndMvdBoxMap.h:65
std::map< Int_t, Int_t > fCh
Definition: PndMvdBoxMap.h:62
std::map< Int_t, Int_t > lCh
Definition: PndMvdBoxMap.h:63
void PndMvdBoxMap::SetMappingFile ( TString  nome)
inline

Definition at line 43 of file PndMvdBoxMap.h.

References fFileName.

Referenced by PndMvdBoxMap().

43 {fFileName = nome;};
TString fFileName
Definition: PndMvdBoxMap.h:67

Member Data Documentation

std::map< Int_t , Int_t > PndMvdBoxMap::box
private

Definition at line 61 of file PndMvdBoxMap.h.

std::map< Int_t , Int_t > PndMvdBoxMap::fCh
private

Definition at line 62 of file PndMvdBoxMap.h.

TString PndMvdBoxMap::fFileName
private

Definition at line 67 of file PndMvdBoxMap.h.

Referenced by SetMappingFile().

std::map< Int_t , TString > PndMvdBoxMap::fMap
private

Definition at line 65 of file PndMvdBoxMap.h.

std::map< Int_t , Int_t > PndMvdBoxMap::lCh
private

Definition at line 63 of file PndMvdBoxMap.h.

Int_t PndMvdBoxMap::nLines
private

Definition at line 68 of file PndMvdBoxMap.h.


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