FairRoot/PandaRoot
PndSttTubeCreator.cxx
Go to the documentation of this file.
1 /*
2  * PndSttTubeCreator.cxx
3  *
4  * Created on: 02.08.2018
5  * Author: tstockmanns
6  */
7 
8 #include <PndSttTubeCreator.h>
9 #include <PndSttTubeIdMap.h>
10 #include <PndGeoHandling.h>
11 
13 
15  // TODO Auto-generated constructor stub
16 
17 }
18 
20  // TODO Auto-generated destructor stub
21 }
22 
25 
26  PndSttTubeParameters* params = new PndSttTubeParameters(tubeId, geoH->GetSensorDimensionsShortId(tubeId).Z());
27  TGeoHMatrix* matrix = geoH->GetMatrixShortId(tubeId);
28 
29  Double_t const *translation = matrix->GetTranslation();
30  Double_t const *rotation = matrix->GetRotationMatrix();
31 
32  double r[3][3];
33  int irot = 0, i = 0, j = 0;
34  for(i = 0; i < 3; i++) {
35  for(j = 0; j < 3; j++) {
36  r[i][j] = rotation[irot];
37  irot++;
38  }
39  }
40 
41  PndSttTube* theTube = new PndSttTube(params,
42  translation[0], translation[1], translation[2],
43  r[0][0],r[0][1],r[0][2],
44  r[1][0],r[1][1],r[1][2],
45  r[2][0],r[2][1],r[2][2],
46  geoH->GetSensorDimensionsShortId(tubeId).X(), geoH->GetSensorDimensionsShortId(tubeId).X() + 0.001);
47 
48  std::pair<int, int > SectorRow = PndSttTubeIdMap::Instance()->GetSectorRowFromTubeId(tubeId);
49  theTube->SetSectorID(SectorRow.first);
50  theTube->SetLayerID(SectorRow.second);
51 
52  //std::cout << "-I- PndSttTubeCreator::GetTube " << tubeId << " : " << SectorRow.first << "/" << SectorRow.second << std::endl;
53 
54  return theTube;
55 }
void SetSectorID(int id)
Definition: PndSttTube.cxx:117
PndSttTube * GetTube(int tubeId)
std::pair< int, int > GetSectorRowFromTubeId(int tubeId)
double r
Definition: RiemannTest.C:14
Int_t i
Definition: run_full.C:25
TGeoRotation rotation
TVector3 GetSensorDimensionsShortId(Int_t shortId)
TGeoHMatrix * GetMatrixShortId(Int_t shortId)
Class to access the naming information of the MVD.
static PndSttTubeIdMap * Instance()
Double_t
static PndGeoHandling * Instance()
PndGeoHandling * geoH
ClassImp(PndAnaContFact)
void SetLayerID(int id)
Definition: PndSttTube.cxx:120