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

PndSdsChargedWeightedPixelMapping: Gets a vector of DigiHits and calculates the cluster center weighted with the charge params: Number of columns in FE, Number of rows in FE, Pixel dimension in x, Pixel dimension in y params are taken from parameter database. More...

#include <PndMvdTopixHitProducer.h>

Public Member Functions

 PndMvdTopixHitProducer ()
 
 PndMvdTopixHitProducer (double dimX, double dimY, int maxcol, int maxrow)
 
virtual ~PndMvdTopixHitProducer ()
 
PndSdsHit GetHit (std::vector< PndSdsDigiTopix4 > pixelArray)
 Main function of class to calculate the PndSdsHit out of the given PndSdsDigis. More...
 

Protected Attributes

Double_t flx
 
Double_t fly
 
Int_t fcols
 
Int_t frows
 
Int_t fVerbose
 

Private Member Functions

virtual TGeoHMatrix GetTransformation (Int_t sensorID)
 
virtual TVector3 GetSensorDimensions (Int_t sensorID)
 

Private Attributes

std::vector< PndSdsDigiTopix4fDigiArray
 

Detailed Description

PndSdsChargedWeightedPixelMapping: Gets a vector of DigiHits and calculates the cluster center weighted with the charge params: Number of columns in FE, Number of rows in FE, Pixel dimension in x, Pixel dimension in y params are taken from parameter database.

PndMvdTopixHitProducer.h

Author
T.Stockmanns t.sto.nosp@m.ckma.nosp@m.nns@f.nosp@m.z-ju.nosp@m.elich.nosp@m..de

Definition at line 17 of file PndMvdTopixHitProducer.h.

Constructor & Destructor Documentation

PndMvdTopixHitProducer::PndMvdTopixHitProducer ( )
PndMvdTopixHitProducer::PndMvdTopixHitProducer ( double  dimX,
double  dimY,
int  maxcol,
int  maxrow 
)
virtual PndMvdTopixHitProducer::~PndMvdTopixHitProducer ( )
inlinevirtual

Definition at line 22 of file PndMvdTopixHitProducer.h.

22 {};

Member Function Documentation

PndSdsHit PndMvdTopixHitProducer::GetHit ( std::vector< PndSdsDigiTopix4 pixelArray)

Main function of class to calculate the PndSdsHit out of the given PndSdsDigis.

Definition at line 18 of file PndMvdTopixHitProducer.cxx.

References col, count, Double_t, fVerbose, hit(), i, row, and t.

19 {
20  //pixelArray = pixelArray;
21  Double_t col = 0, row = 0, charge = 0;
22  Double_t tempCol = 0, tempRow = 0;
23  std::vector<Double_t> timeValues;
24  std::vector<Double_t> timeValueErrors;
25 
26  Int_t count = 0, mcindex=-1;
27  //Double_t local[2], master[2];
28  //TODO: Get away from default 10 Frontends per column?
29  LOG(INFO) << "GetHit:";
30  if (pixelArray.size() == 1){
31 // LOG(INFO) << "SingleHitCluster";
32 // col = pixelArray[0].GetPixelColumn() + ((Int_t)(pixelArray[0].GetFE()%10)) * fcols;
33 // if (col < 0){
34 // col -= 0.5;
35 // col += frows / 2;
36 // }
37 // else col += 0.5;
38 // row = pixelArray[0].GetPixelRow()+ (pixelArray[0].GetFE()/10) * frows;
39 // if (row < 0){
40 // row -= 0.5;
41 // row += flx /2;
42 // }
43 // else row += 0.5;
46 // count = 1;
47 // charge = pixelArray[0].GetCharge();
48  PndSdsDigiTopix4 hit = pixelArray[0];
49  LOG(INFO) << "SingleDigi: " << pixelArray[0];
50  LOG(INFO) << "TimeStamp: " << pixelArray[0].GetCharge() << " " << pixelArray[0].GetTimeStamp();
51  LOG(INFO) << "TimeStamp: " << hit.GetTimeStamp();
52  LOG(INFO) << "SingleDigi: " << pixelArray[0];
53  timeValues.push_back(pixelArray[0].GetTimeStamp());
54  timeValueErrors.push_back(pixelArray[0].GetTimeStampError());
55 
56  }
57  else {
58  LOG(INFO) << "Multiple Hits!";
59  for (UInt_t i = 0; i < pixelArray.size(); i++){
60  //cout << "ActCol / Row" << col << " " << row << " added Col/Row " << pixelArray[i].GetPixelColumn() << " " << pixelArray[i].GetPixelRow() << endl;
61  PndSdsDigiTopix4 hit = pixelArray[i];
62  LOG(INFO) << i << " : Digi : " << pixelArray[i];
63  LOG(INFO) << i << " : Digi : " << pixelArray[i].GetTimeStamp();
64  LOG(INFO) << i << " : Digi : " << hit.GetTimeStamp();
65 // tempCol = pixelArray[i].GetPixelColumn() + (Int_t)(pixelArray[0].GetFE()%10) * fcols;
66 // tempRow = pixelArray[i].GetPixelRow() + pixelArray[0].GetFE()/10 * frows;
67 // col += (tempCol*pixelArray[i].GetCharge());
68 // row += (tempRow*pixelArray[i].GetCharge());
69 // charge += pixelArray[i].GetCharge();
70 // timeValues.push_back(pixelArray[i].GetTimeStamp());
71 // timeValueErrors.push_back(pixelArray[i].GetTimeStampError());
72 // count++;
73  }
74 // if (count > 0){
75 // if (charge > 0){
76 // col /= charge;
77 // row /= charge;
78 // }
79 // col += 0.5;
80 // row += 0.5;
81 // }
82 // else col = row = 0;
83  }
84  if (fVerbose > 1){
85  LOG(INFO) << "Col: " << col << " Row: " << row << std::endl;
86  }
87 
88 // TVector3 offset = GetSensorDimensions(pixelArray[0].GetSensorID());
89 // TVector3 locpos( col*flx - offset.X(), row*fly - offset.Y(), 0);
90 // TVector3 pos = locpos;
91 // pos.SetZ(6 * pixelArray[0].GetSensorID() + 10);
92 //
93 // LOG(INFO) << "Calculated Position: " << col << "/" << row << " : " << pos.X() << "/" << pos.Y();
94 //
95 // Double_t errZ = 2.*GetSensorDimensions(pixelArray[0].GetSensorID()).Z();
96 // TMatrixD locCov(3,3);
97 // locCov[0][0]=flx*flx/12.;
98 // locCov[1][1]=fly*fly/12.;
99 // locCov[2][2]=errZ*errZ/12;
100 // TMatrixD hitCov=locCov;
101 // TVector3 dpos(sqrt(hitCov[0][0]),sqrt(hitCov[1][1]),sqrt(hitCov[2][2]));
102  //LOG(INFO) << "-I- PndMvdTopixHitProducer Error DPos: " << dpos.x() << " " << dpos.y() << " " << dpos.z() << std::endl;
103 
104  Double_t meanTime = 0;
105  //Double_t meanTimeError = 0;
106  Double_t sumVar = 0;
107 
108  LOG(INFO) << "TimeCalculation:";
109  for (UInt_t t = 0; t < timeValues.size(); t++){
110  LOG(INFO) << t << " : " << timeValues[t];
111  meanTime += timeValues[t] / (timeValueErrors[t] * timeValueErrors[t]);
112  sumVar += 1/(timeValueErrors[t] * timeValueErrors[t]);
113  }
114 
115  if (sumVar > 0)
116  meanTime /= sumVar;
117 
118  LOG(INFO) << "MeanTime: " << meanTime;
119 
120 
121  PndSdsHit thehit;//pixelArray[0].GetDetID(),pixelArray[0].GetSensorID(), pos, dpos, -1, charge, pixelArray.size(),mcindex);
122  //thehit.SetCov(hitCov);
123 // thehit.SetTimeStamp(meanTime);
124 // thehit.SetTimeStampError(1/sumVar);
125  //LOG(INFO) << "-I- PndMvdTopixHitProducer TimeStamp: " << tempTime/count << std::endl;
126  return thehit;
127 }
int row
Definition: anaLmdDigi.C:67
Int_t i
Definition: run_full.C:25
Data class to store the digi output of a pixel module.
int col
Definition: anaLmdDigi.C:67
Double_t
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
TTree * t
Definition: bump_analys.C:13
int count
TVector3 PndMvdTopixHitProducer::GetSensorDimensions ( Int_t  sensorID)
privatevirtual

Definition at line 140 of file PndMvdTopixHitProducer.cxx.

141 {
142  TVector3 result(0.2/2, 0.32/2,0.1/2);
143  return result;
144 }
TGeoHMatrix PndMvdTopixHitProducer::GetTransformation ( Int_t  sensorID)
privatevirtual

Definition at line 129 of file PndMvdTopixHitProducer.cxx.

References Double_t, and vec.

130 {
131 
132  TGeoHMatrix transMat;
133  Double_t vec[3];
134  vec[0] = 0.;
135  vec[1] = 0.;
136  vec[2] = sensorID * 6 + 10;
137  return transMat;
138 }
Double_t
dble_vec_t vec[12]
Definition: ranlxd.cxx:380

Member Data Documentation

Int_t PndMvdTopixHitProducer::fcols
protected

Definition at line 28 of file PndMvdTopixHitProducer.h.

std::vector<PndSdsDigiTopix4> PndMvdTopixHitProducer::fDigiArray
private

Definition at line 35 of file PndMvdTopixHitProducer.h.

Double_t PndMvdTopixHitProducer::flx
protected

Definition at line 26 of file PndMvdTopixHitProducer.h.

Double_t PndMvdTopixHitProducer::fly
protected

Definition at line 27 of file PndMvdTopixHitProducer.h.

Int_t PndMvdTopixHitProducer::frows
protected

Definition at line 29 of file PndMvdTopixHitProducer.h.

Int_t PndMvdTopixHitProducer::fVerbose
protected

Definition at line 30 of file PndMvdTopixHitProducer.h.

Referenced by GetHit().


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