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

#include <PndCATracking.h>

Inheritance diagram for PndCATracking:
PndPersistencyTask

Public Member Functions

 PndCATracking (const char *name="TrackingCA", Int_t iVerbose=0)
 
 ~PndCATracking ()
 
void SetMvdPixelHitsBranchName (const TString &name)
 
void SetMvdStripHitsBranchName (const TString &name)
 
void SetSttHitsBranchName (const TString &name)
 
virtual InitStatus Init ()
 
void SetParContainers ()
 
virtual void Exec (Option_t *opt)
 
virtual void Finish ()
 
void SetPersistency (Bool_t val=kTRUE)
 
Bool_t GetPersistency ()
 

Static Public Member Functions

static PndCAPerformance & Instance ()
 Instance. More...
 

Private Member Functions

void WriteMVDHits (std::vector< PndCAGBHit > &vHits, std::fstream &outH, std::fstream &outHL, std::fstream &outMCT, std::fstream &outMCP, int &iHit, map< int, unsigned int > &nHitsInMCTrack, bool isPixel)
 
 ClassDef (PndCATracking, 1)
 

Static Private Member Functions

static void CATrackParToFairTrackParP (FairTrackParP *fairParam, const PndCATrackParam *caParam)
 

Private Attributes

TString fMvdPixelHitsBranchName
 
TString fMvdStripHitsBranchName
 
TString fMvdPixelClusterBranchName
 
TString fMvdStripClusterBranchName
 
TString fMvdPixelDigiBranchName
 
TString fMvdStripDigiBranchName
 
TString fSttHitsBranchName
 
TString fMvdPointsBranchName
 
TString fSttPointsBranchName
 
TString fMCTracksBranchName
 
TClonesArray * fMvdPixelHitsArray
 
TClonesArray * fMvdStripHitsArray
 
TClonesArray * fMvdPixelClusterArray
 
TClonesArray * fMvdStripClusterArray
 
TClonesArray * fMvdPixelDigiArray
 
TClonesArray * fMvdStripDigiArray
 
TClonesArray * fSttHitsArray
 
TClonesArray * fMvdPointsArray
 
TClonesArray * fSttPointsArray
 
TClonesArray * fMCTrackArray
 
TClonesArray * fTubeArray
 
PndGeoHandlingfGeoH
 
TClonesArray * fSttMvdPndTrackArray
 
bool fDoPerformance
 

Detailed Description

Definition at line 29 of file PndCATracking.h.

Constructor & Destructor Documentation

PndCATracking::PndCATracking ( const char *  name = "TrackingCA",
Int_t  iVerbose = 0 
)

Definition at line 70 of file PndCATracking.cxx.

References fDoPerformance, and PndPersistencyTask::SetPersistency().

70  :
72  fMvdPixelClusterBranchName("MVDPixelClusterCand"), fMvdStripClusterBranchName("MVDStripClusterCand"),
73  fMvdPixelDigiBranchName("MVDPixelDigis"), fMvdStripDigiBranchName("MVDStripDigis"),
74  fSttHitsBranchName("STTHit"),
75  fMvdPointsBranchName("MVDPoint"),fSttPointsBranchName("STTPoint"),fMCTracksBranchName("MCTrack"),fTubeArray(NULL),
78 {
79 #ifdef DO_TPCCATRACKER_EFF_PERFORMANCE
80  fDoPerformance = 1;
81 #endif
82  SetPersistency(kTRUE);
83 }
TClonesArray * fSttMvdPndTrackArray
Definition: PndCATracking.h:83
TString fMvdPointsBranchName
Definition: PndCATracking.h:60
TString fMCTracksBranchName
Definition: PndCATracking.h:62
void SetPersistency(Bool_t val=kTRUE)
TString fMvdPixelDigiBranchName
Definition: PndCATracking.h:56
TString fSttPointsBranchName
Definition: PndCATracking.h:61
TString fMvdStripDigiBranchName
Definition: PndCATracking.h:57
TString fSttHitsBranchName
Definition: PndCATracking.h:58
TString name
TString fMvdStripHitsBranchName
Definition: PndCATracking.h:53
TString fMvdStripClusterBranchName
Definition: PndCATracking.h:55
TString fMvdPixelClusterBranchName
Definition: PndCATracking.h:54
Int_t iVerbose
TClonesArray * fTubeArray
Definition: PndCATracking.h:78
TString fMvdPixelHitsBranchName
Definition: PndCATracking.h:52
PndCATracking::~PndCATracking ( )

Definition at line 85 of file PndCATracking.cxx.

86 {
87 }

Member Function Documentation

void PndCATracking::CATrackParToFairTrackParP ( FairTrackParP *  fairParam,
const PndCATrackParam caParam 
)
staticprivate

Definition at line 212 of file PndCATracking.cxx.

References CAMath::Abs(), PndCATrackParam::Angle(), CAMath::Cos(), PndCATrackParam::Cov(), Double_t, PndCATrackParam::DzDs(), PndCATrackParam::GetCosPhi(), i, mE, pz, PndCATrackParam::QPt(), CAMath::Sin(), PndCATrackParam::SinPhi(), CAMath::Sqrt(), PndCATrackParam::X(), x, x0, PndCATrackParam::Y(), y, y0, PndCATrackParam::Z(), z, and z0.

Referenced by Exec().

213 {
214 
215  const double cA = TMath::Cos( kfParam->Angle() );
216  const double sA = -TMath::Sin( kfParam->Angle() );
217 
218  double x0 = kfParam->X();
219  double y0 = kfParam->Y();
220  double z0 = kfParam->Z();
221 
222  double pz0 = -kfParam->DzDs()/TMath::Abs(kfParam->QPt());
223  double py0 = -kfParam->SinPhi()/TMath::Abs(kfParam->QPt());
224  double px0 = -kfParam->GetCosPhi()/TMath::Abs(kfParam->QPt());
225 
226  double x = -sA*x0 + cA*y0;
227  double y = cA*x0 + sA*y0;
228  double z = -z0;
229 
230  double px =-sA*px0 + cA*py0;
231  double py = cA*px0 + sA*py0;
232  double pz = -pz0;
233 
234  int q = kfParam->QPt()>0 ? 1 : -1;
235 
236  Double_t cov[15], cov1[15];
237 
238  for(int i=0; i<15; i++)
239  cov[i] = kfParam->Cov()[i];
240 
241  double mB = 1/TMath::Sqrt(1 + kfParam->DzDs()*kfParam->DzDs());
242  double mA = -kfParam->QPt() * kfParam->DzDs() *mB*mB*mB;
243  double mC = 1/kfParam->GetCosPhi();
244  double mE = mC*mC*mC;
245  double mD = kfParam->DzDs() * kfParam->SinPhi() * mC*mC*mC;
246 
247  cov1[14] = cov[2];
248  cov1[13] = cov[1];
249  cov1[12] = cov[0];
250  cov1[11] = mE *cov[7] + cov[4]* mD;
251  cov1[10] = mE *cov[6] + cov[3]* mD;
252  cov1[ 9] = mE*mE* cov[9] + 2* mE *cov[8]* mD + cov[5] *mD*mD;
253  cov1[ 8] = mC *cov[4];
254  cov1[ 7] = mC *cov[3];
255  cov1[ 6] = mC *(mE* cov[8] + cov[5]* mD);
256  cov1[ 5] = mC*mC* cov[5];
257  cov1[ 4] = mB *cov[11] + mA *cov[7];
258  cov1[ 3] = mB *cov[10] + mA *cov[6];
259  cov1[ 2] = mB *mE *cov[13] + mA* mE* cov[9] + mB* cov[12] *mD + mA* cov[8]* mD;
260  cov1[ 1] = mC *(mB *cov[12] + mA* cov[8]);
261  cov1[ 0] = 2*mA *mB *cov[13] + mB*mB* cov[14] + mA*mA* cov[9];
262 
263 
264  fairParam->SetTrackPar(x,y,z,px,py,pz,q, cov1, TVector3(0,0,0), TVector3(-sA,cA,0), TVector3(cA,sA,0), TVector3(0,0,-1));
265 }
Double_t z0
Definition: checkhelixhit.C:62
Double_t x0
Definition: checkhelixhit.C:70
Int_t i
Definition: run_full.C:25
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
static T Sin(const T &x)
Definition: PndCAMath.h:42
double mE
static T Cos(const T &x)
Definition: PndCAMath.h:43
static T Abs(const T &x)
Definition: PndCAMath.h:39
Double_t
Double_t y0
Definition: checkhelixhit.C:71
Double_t z
Double_t x
Double_t y
double pz[39]
Definition: pipisigmas.h:14
PndCATracking::ClassDef ( PndCATracking  ,
 
)
private
void PndCATracking::Exec ( Option_t *  opt)
virtual

Definition at line 268 of file PndCATracking.cxx.

References CAMath::Abs(), PndTrackCand::AddHit(), buf, C(), CATrackParToFairTrackParP(), compareSdsPoints(), compareSttPoints(), cos(), CR, Double_t, exit(), f, fabs(), fDoPerformance, PndCAGBTracker::FindTracks(), PndCAGBTrack::FirstHitRef(), fMCTrackArray, fMvdPixelHitsArray, fMvdPointsArray, fMvdStripHitsArray, fSttHitsArray, fSttHitsBranchName, fSttMvdPndTrackArray, fSttPointsArray, fTubeArray, fVerbose, GetEntriesFast(), PndSttTube::GetHalfLength(), PndSttHit::GetIsochrone(), PndSttHit::GetIsochroneError(), PndMCTrack::GetMomentum(), PndMCTrack::GetMotherID(), PndCATrackMCPointContainer::GetNMvdPoints(), PndCATrackMCPointContainer::GetNSttPoints(), PndCAGBTracker::GetParametersNonConst(), PndMCTrack::GetPdgCode(), PndSttTube::GetPosition(), PndSttTube::GetRadIn(), PndSttTube::GetRotationMatrix(), PndSdsMCPoint::GetSensorID(), PndMCTrack::GetStartVertex(), PndSttHit::GetTubeID(), PndSttPoint::GetTubeID(), PndSttTube::GetWireDirection(), gGeoManager, h, hit(), PndCAGBTracker::Hit(), i, PndCAGBTrack::InnerParam(), PndGeoHandling::Instance(), PndCAGBHit::IRow(), PndCATrackMCPointContainer::MvdArray, nHits, PndCAGBTrack::NHits(), PndCAGBTracker::NHits(), PndCAGBTracker::NTimers(), PndCAGBTracker::NTracks(), out, PndCAGBTrack::OuterParam(), p, Pi, pi, PndCAGBHit::PndDetID(), PndCAGBHit::PndHitID(), point, pz, r, PndCAGBTracker::ReadSettings(), PndCAGBHit::SetAngle(), PndCAParam::SetBz(), PndCAGBHit::SetC(), PndCAGBHit::SetErr2R(), PndCAGBHit::SetGlobalX(), PndCAGBHit::SetGlobalY(), PndCAGBTracker::SetHits(), PndCAGBHit::SetID(), PndCAGBHit::SetIRow(), PndTrackCand::setMcTrackId(), PndCAGBHit::SetPndDetID(), PndCAGBHit::SetPndHitID(), PndCAGBHit::SetR(), PndTrack::SetRefIndex(), PndCAGBHit::SetTubeHalfLength(), PndCAGBHit::SetTubeR(), PndCAGBHit::SetXW(), PndCAGBHit::SetYW(), PndCAGBHit::SetZ(), PndCAGBHit::SetZW(), sin(), PndCAGBTracker::SliceTrackerCpuTime(), PndCAGBTracker::SliceTrackerTime(), sqrt(), CAMath::Sqrt(), PndCAGBTracker::StatTime(), PndCATrackMCPointContainer::SttArray, tr, PndCAGBTracker::Track(), PndCAGBTracker::TrackHit(), TString, WriteMVDHits(), x, y, and z.

269 {
270  if (fVerbose>0) std::cout<<"PndCATracking::Exec"<<std::endl;
271 
272  fSttMvdPndTrackArray->Delete();
273 
274  FairField* MF=FairRunAna::Instance()->GetField();
275 
276  Double_t xyz[3]={0,0,0};
277  Double_t fieldValue[3];
278  MF->Field(xyz,fieldValue);
279  double Bz = fieldValue[2];
280 
281  static int iEvent = -1;
282  iEvent++;
283 
284  string filePrefix = "./CATrackerData";
285  TString fadata_name = "CATrackerData/event";
286  filePrefix += "/";
287  static TFile* perfHistoFile = 0;
288 
289  fadata_name += iEvent;
290  std::fstream outH;
291  std::fstream outHL;
292  std::fstream outMCT;
293  std::fstream outMCP;
294 
295  if( fDoPerformance ){
296  if( !perfHistoFile ){
297  perfHistoFile = new TFile( (filePrefix + "CATrackerPerformance.root").data(), "RECREATE" );
298  if( !perfHistoFile->IsOpen() ){
299  gSystem->Exec( "mkdir ./CATrackerData");
300  perfHistoFile = new TFile( (filePrefix + "CATrackerPerformance.root").data(), "RECREATE" );
301  }
302  }
303  outH.open ( fadata_name + "_hits.data", std::fstream::out);
304  outHL.open( fadata_name + "_hitLabels.data", std::fstream::out);
305  outMCT.open( fadata_name + "_MCTracks.data", std::fstream::out);
306  outMCP.open( fadata_name + "_MCPoints.data", std::fstream::out);
307  }
308 
309  int nMvdhits=0;
310  // Calculate a number of MVD hits in the barrel part
311  for(int iHMvdP=0; iHMvdP<fMvdPixelHitsArray->GetEntriesFast(); iHMvdP++)
312  {
313  //PndSdsHit* currenthit = (PndSdsHit*) fMvdPixelHitsArray->At(iHMvdP);
314  //Int_t sensorID = currenthit->GetSensorID();
315  //gGeoManager->cd(PndGeoHandling::Instance()->GetPath(sensorID));
316  //TGeoHMatrix* transMat = gGeoManager->GetCurrentMatrix();
317  //Double_t *mmm = transMat->GetRotationMatrix();
318  // if(fabs(mmm[6]) < 0.999 && fabs(mmm[7]) < 0.999 ) continue;
319  nMvdhits++;
320  }
321 
322  /*
323  cout<<"\n\nCA pixel detector: "<< FairRootManager::Instance()->GetBranchId(fMvdPixelHitsBranchName)<<endl;
324  cout<<"CA strip detector: "<< FairRootManager::Instance()->GetBranchId(fMvdStripHitsBranchName)<<endl;
325  cout<<"N of MVD Pixels: "<<nMvdhits<<endl;
326  */
327  for(int iHMvdS=0; iHMvdS<fMvdStripHitsArray->GetEntriesFast(); iHMvdS++)
328  {
329  //PndSdsHit* currenthit = (PndSdsHit*) fMvdStripHitsArray->At(iHMvdS);
330  //Int_t sensorID = currenthit->GetSensorID();
331  //gGeoManager->cd(PndGeoHandling::Instance()->GetPath(sensorID));
332  //TGeoHMatrix* transMat = gGeoManager->GetCurrentMatrix();
333  //Double_t *mmm = transMat->GetRotationMatrix();
334  // if( fabs(mmm[6]) < 0.999 && fabs(mmm[7]) < 0.999 ) continue;
335  nMvdhits++;
336  }
337  //cout<<"nTotal N of MVD hits: "<<nMvdhits<<endl;
338 
339  const Int_t nHits = fSttHitsArray->GetEntriesFast() + nMvdhits;
340 
341  Int_t nPoints = 0;//fSttPointsArray->GetEntriesFast() + fMvdPointsArray->GetEntriesFast();
342  const Int_t nMCTracks = fMCTrackArray->GetEntriesFast();
343 
344  map<int, unsigned int> nHitsInMCTrack, nMCPointsInMCTrack, FirstMCPointIDInMCTrack;
345  PndCATrackMCPointContainer* MCTrackSortedArray = new PndCATrackMCPointContainer[fMCTrackArray->GetEntriesFast()];
346 
347  for (Int_t iMvd=0; iMvd<fMvdPointsArray->GetEntriesFast(); iMvd++)
348  {
349  PndSdsMCPoint* MvdPoint = (PndSdsMCPoint*)fMvdPointsArray->At(iMvd);
350  int sensorID = MvdPoint->GetSensorID();
351  gGeoManager->cd(PndGeoHandling::Instance()->GetPath(sensorID));
352  TGeoHMatrix* transMat = gGeoManager->GetCurrentMatrix();
353  Double_t *mmm = transMat->GetRotationMatrix();
354  if(fabs(mmm[6]) < 0.999 && fabs(mmm[7]) < 0.999) { continue; }// save only points from the barrel part
355  //if(!(fabs(mmm[6]) < 0.999 && fabs(mmm[7]) < 0.999)) { continue; }// save only points from the forward part
356 
357  MCTrackSortedArray[MvdPoint->GetTrackID()].MvdArray.push_back(MvdPoint);
358  nPoints++;
359 
360  //Double_t x = MvdPoint->GetX();
361  //Double_t y = MvdPoint->GetY();
362  //Double_t z = MvdPoint->GetZ();
363  //Double_t r = TMath::Sqrt(x*x + y*y);
364  //int iSta = -1;
365 // if( (r>0.) && (r<3.5) ) iSta = 2;
366 // if( (r>3.5) && (r<7.5) ) iSta = 3;
367 // if( (r>7.5) && (r<11.0) ) iSta = 4;
368 // if( (r>11.0) && (r<15.0) ) iSta = 5;
369 
370  //if( (z>0.) && (z<3.) ) iSta = 0;
371  //if( (z>3.) && (z<5.5) ) iSta = 1;
372  //if( (z>5.5) && (z<8.0) ) iSta = 2;
373  //if( (z>8.0) && (z<12.0) ) iSta = 3;
374  //if( (z>12.0) && (z<18.5) ) iSta = 4;
375  //if( (z>18.5) && (z<24.5) ) iSta = 5;
376 
377  }
378 
379  for (Int_t iSts=0; iSts<fSttPointsArray->GetEntriesFast(); iSts++)
380  {
381  PndSttPoint* SttPoint = (PndSttPoint*)fSttPointsArray->At(iSts);
382  MCTrackSortedArray[SttPoint->GetTrackID()].SttArray.push_back(SttPoint);
383  nPoints++;
384  }
385 
386  if( fDoPerformance ){
387  outH << nHits << endl;
388  outHL << nHits << endl;
389  outMCP << nPoints << endl;
390  outMCT << nMCTracks << endl;
391  }
392 
393  std::vector<PndCAGBHit> vHits;
394 
395  int iHit = 0;
396 
397  //Save MVD Pixel hits
398  WriteMVDHits( vHits, outH, outHL, outMCT, outMCP, iHit, nHitsInMCTrack, 1);
399 
400  //Save MVD Strip hits
401  WriteMVDHits( vHits, outH, outHL, outMCT, outMCP, iHit, nHitsInMCTrack, 0);
402 
403 
404  //Save STT hits
405 
406  Int_t sttLinkType = FairRootManager::Instance()->GetBranchId("STTPoint");
407 
408  std::map<Int_t,Int_t> tubeMap;
409  std::map<Int_t,Int_t>::iterator mapIt;
410 
411 
412  for(int iHStt=0; iHStt<fSttHitsArray->GetEntriesFast(); iHStt++)
413  {
414  PndSttHit* currenthit = (PndSttHit*) fSttHitsArray->At(iHStt);
415  Int_t tubeID = currenthit->GetTubeID();
416  mapIt = tubeMap.find('b');
417  if( mapIt == tubeMap.end() ){
418  tubeMap.insert( std::pair<Int_t,Int_t>(tubeID,1) );
419  } else {
420  mapIt->second++;
421  if( mapIt->second >3 ) continue; //SG!!!
422  }
423 
424  PndSttTube *tube = (PndSttTube *) fTubeArray->At(tubeID);
425  TVector3 wire_direction = tube->GetWireDirection();
426 
427  const Double_t kSS = 1.5; // coefficient between size and sigma
428  const Double_t dXY = tube->GetRadIn();
429  const Double_t errXY = dXY/kSS;
430  const Double_t errXY2 = errXY*errXY;
431  const Double_t errZ = tube->GetHalfLength()/kSS*sqrt(26); // 26 rows with basicaly same information
432 
433  TMatrixT<Double_t> RM = tube->GetRotationMatrix();
434  TMatrixT<Double_t> C(3,3); // CovMatrix
435  C[0][0] = errXY2;
436  C[1][1] = errXY2;
437  C[2][2] = errZ*errZ;
438  C[0][1] = C[0][2] = C[1][0] = C[1][2] = C[2][0] = C[2][1] = 0;
439 
440  TMatrixT<Double_t> CR = C; // rotated CovMatrix
441 
442  CR = RM*C;
443  CR = CR*RM.Transpose(RM);
444 
445  Double_t radius= currenthit->GetIsochrone();
446 
447  // error calculation according to the curve chosen by flag
448  Double_t closestDistanceError = currenthit->GetIsochroneError();
449  TVector3 position = tube->GetPosition(); // CHECK added
450 
451  Double_t x = position.X();
452  Double_t y = position.Y();
453  Double_t z = position.Z();
454 
455  Int_t iSta=0;
456  Double_t A = 0;
457  {
458  A = atan( fabs(y/x) );
459  const Double_t pi = TMath::Pi();//3.14159265359;
460  const Double_t pi2 = pi/2;
461  if ( y >= 0 && x >= 0 ) A = pi2 - A;
462  if ( y < 0 && x >= 0 ) A = pi2 + A;
463  if ( y < 0 && x < 0 ) A = 3*pi2 - A;
464  if ( y >= 0 && x < 0 ) A = 3*pi2 + A;
465 
466  A = floor(A/pi/2*6)*pi/3;
467  // turn by -(A+3.1415/6)
468  A = -(A+pi/6);
469  //const Double_t xx = x*cos(A)+y*sin(A);
470  const Double_t yy = -x*sin(A)+y*cos(A);
471  Double_t iS = (yy - 16.619027)/sqrt(3.f/4)/1.01;
472  if ( iS < 7.5 ) iSta = floor(iS+0.5);
473  else if ( iS-.1547 < 9.5 ) iSta = floor(iS-.1547+0.5);
474  else if ( iS-.5883 < 11.5 ) iSta = floor(iS-.5883+0.5);
475  else if ( iS-1.022 < 13.5 ) iSta = floor(iS-1.022+0.5);
476  else if ( iS-1.4556 < 15.5 ) iSta = floor(iS-1.4556+0.5);
477  else iSta = floor(iS-2+0.5);
478  }
479  iSta += 4; // 4 MVD stations
480 
481  int trackID = -1;
482  FairMultiLinkedData links = currenthit->GetLinksWithType(sttLinkType);
483  if( links.GetNLinks() >0 ){
484  int iPoint = links.GetLink(0).GetIndex();
485  PndSttPoint* point = (PndSttPoint*) fSttPointsArray->At(iPoint);
486  if( !point ){
487  cout<<"CA tracker: wrong index of Stt point: "<<iPoint<<" of "<<fSttPointsArray->GetEntriesFast()<<endl;
488  exit(0); //SG!!
489  } else {
490  trackID = point->GetTrackID();
491  }
492  } else {
493  cout<<"CA tracker: stt hit has no link to stt point"<<endl;
494  exit(0); //SG!!
495  }
496  //cout<<"hit, sta "<<iSta<<" trackid "<<trackID<<" tubeID "<<tubeID<<" radius "<<radius<<endl;
497  PndCAGBHit h;
498  h.SetGlobalX( x );
499  h.SetGlobalY( y );
500  h.SetZ( z );
501  h.SetXW(x);
502  h.SetYW(y);
503  h.SetZW(z);
504 
505  h.SetR( radius );
506  h.SetC( CR );
507  h.SetErr2R( closestDistanceError*closestDistanceError );
508  h.SetIRow(iSta);
509  h.SetID( iHit);
510  // h.SetPndDetID(currenthit->GetDetectorID());
511  h.SetPndDetID(FairRootManager::Instance()->GetBranchId(fSttHitsBranchName));
512  h.SetPndHitID( iHStt );
513  h.SetAngle( -A );
514 
515  h.SetTubeR( tube->GetRadIn() );
516  h.SetTubeHalfLength( tube->GetHalfLength() );
517 
518  vHits.push_back(h);
519 
520  if ( fDoPerformance ){
521  outH << h;
522  outHL << trackID << " " << -1 << " " << -1 << endl;
523  }
524  /*
525  outH << x << " " << y << " " << z << " " << radius << endl;
526  outH << CR[0][0] << " " << CR[0][1] << " " << CR[0][2] << endl;
527  outH << CR[1][0] << " " << CR[1][1] << " " << CR[1][2] << endl;
528  outH << CR[2][0] << " " << CR[2][1] << " " << CR[2][2] << endl;
529  outH << closestDistanceError*closestDistanceError << endl;
530  outH << tube->GetRadIn() << " " << tube->GetHalfLength() << endl;
531  outH << wire_direction.X() << " " << wire_direction.Y() << " " << wire_direction.Z() << endl;
532  outH << iSta << " " << iHit << " " << A << endl;
533  */
534  iHit++;
535 
536  if ( nHitsInMCTrack.find(trackID) != nHitsInMCTrack.end() ) {
537  nHitsInMCTrack[trackID]++;
538  } else {
539  nHitsInMCTrack[trackID] = 1;
540  }
541  }
542 
543 
544  int nMCPoints = 0;
545  for ( int iTr = 0; iTr < nMCTracks; iTr++ ){
546 
547  //save MVD points
548  std::sort(MCTrackSortedArray[iTr].MvdArray.begin(), MCTrackSortedArray[iTr].MvdArray.end(), compareSdsPoints);
549  std::sort(MCTrackSortedArray[iTr].SttArray.begin(), MCTrackSortedArray[iTr].SttArray.end(), compareSttPoints);
550 
551  for(int iPStt=0; iPStt<MCTrackSortedArray[iTr].GetNMvdPoints(); iPStt++)
552  {
553  PndSdsMCPoint* point = MCTrackSortedArray[iTr].MvdArray[iPStt];
554  int trackID = point->GetTrackID();
555 
556  Double_t q = 1;
557  { // get charge
558  if ( trackID < fMCTrackArray->GetEntriesFast() ) {
559  const PndMCTrack* mcTr = (PndMCTrack*) fMCTrackArray->At(trackID);
560  if ( mcTr ) {
561  TParticlePDG * part = TDatabasePDG::Instance()->GetParticle(mcTr->GetPdgCode());
562  if ( part )
563  q = part->Charge()/3.f;
564  }
565  else { cout << "CA tracker: Bad MCTracks2" << endl; }
566  }
567  else { cout << "CA traker: Bad MCTracks" << endl; }
568  }
569 
570  Double_t x = point->GetX(), y = point->GetY();
571  Double_t r = TMath::Sqrt(x*x + y*y);
572  int iSta = -1;
573  if( (r>0.) && (r<3.5) ) iSta = 0;
574  if( (r>3.5) && (r<7.5) ) iSta = 1;
575  if( (r>7.5) && (r<11.0) ) iSta = 2;
576  if( (r>11.0) && (r<15.0) ) iSta = 3;
577 
578  Double_t px = point->GetPx();
579  Double_t py = point->GetPy();
580  Double_t pz = point->GetPz();
581  Double_t p = sqrt( px*px + py*py + pz*pz );
582  if(TMath::Abs(p)<1.e-6)
583  {
584  px = 1.e-6;
585  py = 1.e-6;
586  pz = 1.e-6;
587  p = 1.e-6;
588  }
589 
590  if ( fDoPerformance ){
591  outMCP << point->GetX() << " " << point->GetY() << " " << point->GetZ() << endl;
592  outMCP << px << " " << py << " " << pz << " "
593  << q/p << endl;
594  outMCP << 0 << " " << iSta << " " << trackID << " " << trackID << endl;
595  }
596 
597  if ( nMCPointsInMCTrack.find(trackID) != nMCPointsInMCTrack.end() ) {
598  nMCPointsInMCTrack[trackID]++;
599  } else {
600  nMCPointsInMCTrack[trackID] = 1;
601  FirstMCPointIDInMCTrack[trackID] = nMCPoints;
602  }
603  nMCPoints++;
604  }
605 
606  //save STT points
607  for(int iPStt=0; iPStt<MCTrackSortedArray[iTr].GetNSttPoints(); iPStt++)
608  {
609  PndSttPoint* point = MCTrackSortedArray[iTr].SttArray[iPStt];
610  int trackID = point->GetTrackID();
611 
612  Double_t q = 1;
613  { // get charge
614  if ( trackID < fMCTrackArray->GetEntriesFast() ) {
615  const PndMCTrack* mcTr = (PndMCTrack*) fMCTrackArray->At(trackID);
616  if ( mcTr ) {
617  TParticlePDG * part = TDatabasePDG::Instance()->GetParticle(mcTr->GetPdgCode());
618  if ( part )
619  q = part->Charge()/3.f;
620  }
621  else { cout << "CA tracker: Bad MCTracks2" << endl; }
622  }
623  else { cout << "CA tracker: Bad MCTracks" << endl; }
624  }
625 
626  int tubeID = point->GetTubeID();
627  PndSttTube *tube = (PndSttTube *) fTubeArray->At(tubeID);
628  TVector3 position = tube->GetPosition(); // CHECK added
629  Double_t x = position.X();
630  Double_t y = position.Y();
631 
632  Int_t iSta=0;
633  Double_t A = 0;
634  {
635  A = atan( fabs(y/x) );
636  const Double_t pi = TMath::Pi();//3.14159265359;
637  const Double_t pi2 = pi/2;
638  if ( y >= 0 && x >= 0 ) A = pi2 - A;
639  if ( y < 0 && x >= 0 ) A = pi2 + A;
640  if ( y < 0 && x < 0 ) A = 3*pi2 - A;
641  if ( y >= 0 && x < 0 ) A = 3*pi2 + A;
642 
643  A = floor(A/pi/2*6)*pi/3;
644  // turn by -(A+3.1415/6)
645  A = -(A+pi/6);
646  //const Double_t xx = x*cos(A)+y*sin(A);
647  const Double_t yy = -x*sin(A)+y*cos(A);
648  Double_t iS = (yy - 16.619027)/sqrt(3.f/4)/1.01;
649  if ( iS < 7.5 ) iSta = floor(iS+0.5);
650  else if ( iS-.1547 < 9.5 ) iSta = floor(iS-.1547+0.5);
651  else if ( iS-.5883 < 11.5 ) iSta = floor(iS-.5883+0.5);
652  else if ( iS-1.022 < 13.5 ) iSta = floor(iS-1.022+0.5);
653  else if ( iS-1.4556 < 15.5 ) iSta = floor(iS-1.4556+0.5);
654  else iSta = floor(iS-2+0.5);
655  }
656 // iSta += 6; // 6 MVD stations
657  iSta += 4; // 4 MVD barrel stations
658  Double_t px = point->GetPx();
659  Double_t py = point->GetPy();
660  Double_t pz = point->GetPz();
661  Double_t p = sqrt( px*px + py*py + pz*pz );
662  if(TMath::Abs(p)<1.e-6)
663  {
664  px = 1.e-6;
665  py = 1.e-6;
666  pz = 1.e-6;
667  p = 1.e-6;
668  }
669 
670  if( fDoPerformance ){
671  outMCP << point->GetX() << " " << point->GetY() << " " << point->GetZ() << endl;
672  outMCP << px << " " << py << " " << pz << " "
673  << q/p << endl;
674  outMCP << 0 << " " << iSta << " " << trackID << " " << trackID << endl;
675  }
676 
677  if ( nMCPointsInMCTrack.find(trackID) != nMCPointsInMCTrack.end() ) {
678  nMCPointsInMCTrack[trackID]++;
679  } else {
680  nMCPointsInMCTrack[trackID] = 1;
681  FirstMCPointIDInMCTrack[trackID] = nMCPoints;
682  }
683  nMCPoints++;
684  }
685 
686 
687  const PndMCTrack* mcTr = (PndMCTrack*) fMCTrackArray->At(iTr);
688 
689  if( fDoPerformance ){
690  if ( !mcTr ) {
691  outMCT << -1 << " " << -1 << endl;
692  outMCT << 0 << " " << 0 << " " << 0 << " " << 0 << " " << 0 << " " << 0 << " " << 0 << endl;
693  outMCT << 0 << " " << 0 << " " << 0 << " " << 0 << " " << 0 << " " << 0 << " " << 0 << endl;
694  outMCT << 0 << " " << 0 << endl;
695  outMCT << 0 << " " << 0 << " " << 0 << endl;
696  outMCT << 0 << " " << 0 << " " << 1 << endl;
697  } else {
698  Int_t pdg = mcTr->GetPdgCode();
699  Double_t px = mcTr->GetMomentum().X();
700  Double_t py = mcTr->GetMomentum().Y();
701  Double_t pz = mcTr->GetMomentum().Z();
702  Double_t p = sqrt( px*px + py*py + pz*pz );
703  if(TMath::Abs(p)<1.e-6){
704  px = 1.e-6;
705  py = 1.e-6;
706  pz = 1.e-6;
707  p = 1.e-6;
708  }
709  Double_t q = 1;
710  { // get charge
711  TParticlePDG * part = TDatabasePDG::Instance()->GetParticle(pdg);
712  if ( part )
713  q = part->Charge()/3.f;
714  }
715  //Double_t ex,ey,ez,qp;
716  outMCT << mcTr->GetMotherID() << " " << pdg << endl;
717  outMCT << mcTr->GetStartVertex().X() << " " << mcTr->GetStartVertex().Y() << " " << mcTr->GetStartVertex().Z() << " "
718  << px/fabs(p) << " " << py/fabs(p) << " " << pz/fabs(p) << " " << q/p << endl;
719  outMCT << 0 << " " << 0 << " " << 0 << " " << 0 << " " << 0 << " " << 0 << " " << 0 << endl;
720  outMCT << p << " " << sqrt( px*px + py*py ) << endl;
721  outMCT << nHitsInMCTrack[iTr] << " " << nMCPointsInMCTrack[iTr] << " " << FirstMCPointIDInMCTrack[iTr] << endl;
722  outMCT << 0 << " " << 0 << " " << 1 << endl;
723  }
724  }
725  }
726 
727  if(MCTrackSortedArray) delete[] MCTrackSortedArray;
728 
729  if( fDoPerformance ){
730  outH.close();
731  outHL.close();
732  outMCT.close();
733  outMCP.close();
734  }
735 
736  // tracking
737 
738 
739 #ifdef DO_TPCCATRACKER_EFF_PERFORMANCE
740  /*PndCAPerformance * */perf = &PndCAPerformance::Instance(); //[R.K. 9/2018] unshadow
741 #endif
742 
743  PndCAGBTracker *tracker = 0;
744  const PndCAGBTracker *trackerConst = 0;
745 
746  tracker = new PndCAGBTracker;
747 
748 
749  /*if ( !tracker->ReadSettingsFromFile(filePrefix) ) {
750  cout << "ERROR: Settings file can't be opened!" << endl;
751  }*/
752 
753  std::string str =
754 "30 \
755 -20 \
756 0 2 0.0048 1.6 0 2 2 \
757 1 4 0.0048 1.6 0 2 2 \
758 2 9 0.0048 1.6 0 2 2 \
759 3 12 0.0048 1.6 0 2 2 \
760 4 16.619 0.0006 0.016 0 1 4 \
761 5 17.4937 0.0006 0.016 0 1 4 \
762 6 18.3684 0.0006 0.016 0 1 4 \
763 7 19.2431 0.0006 0.016 0 1 4 \
764 8 20.1178 0.0006 0.016 0 1 4 \
765 9 20.9924 0.0006 0.016 0 1 6 \
766 10 21.8671 0.0006 0.016 0 1 6 \
767 11 22.7418 0.0006 0.016 0 1 6 \
768 12 23.7518 0.0006 0.016 0.0523596 1 6 \
769 13 24.6265 0.0006 0.016 0.0523596 1 6 \
770 14 25.8805 0.0006 0.016 -0.0523596 1 6 \
771 15 26.7552 0.0006 0.016 -0.0523596 1 6 \
772 16 28.0092 0.0006 0.016 0.0523596 1 6 \
773 17 28.8839 0.0006 0.016 0.0523596 1 6 \
774 18 30.1378 0.0006 0.016 -0.0523596 1 6 \
775 19 31.0126 0.0006 0.016 -0.0523596 1 6 \
776 20 32.3634 0.0006 0.016 0 1 5 \
777 21 33.2381 0.0006 0.016 0 1 4 \
778 22 34.1128 0.0006 0.016 0 1 4 \
779 23 34.9874 0.0006 0.016 0 1 4 \
780 24 35.8621 0.0006 0.016 0 1 4 \
781 25 36.7368 0.0006 0.016 0 1 4 \
782 26 37.6115 0.0006 0.016 0 1 4 \
783 27 38.4862 0.0006 0.016 0 1 4 \
784 28 39.3609 0.0006 0.016 0 1 4 \
785 29 40.2356 0.0006 0.016 0 1 4";
786 
787  std::istringstream settings(str);
788  tracker->ReadSettings(settings);
789 
790  // set settings
791 
792  tracker->GetParametersNonConst().SetBz(Bz);
793 
794  trackerConst = tracker;
795 
796  do{
797  int kEvents = iEvent;
798  char buf[6];
799  sprintf( buf, "%d", kEvents );
800  const string fileName = filePrefix + "event" + string(buf) + "_";
801 
802  // std::cout << "CA tracker: Loading Event " << kEvents << "..." << std::endl;
803  tracker->SetHits( vHits );
804  /*
805  if (!tracker->ReadHitsFromFile(fileName)) {
806  cout << "Hits Data for Event " << kEvents << " can't be read." << std::endl;
807  break;
808  }
809  */
810  //std::cout << "Event " << kEvents << " CPU reconstruction..." << std::endl;
811 
812 #ifdef DO_TPCCATRACKER_EFF_PERFORMANCE
813  // cout<<"Filename "<<fileName<<endl;
814  if ( fDoPerformance && perf ) {
815  perf->SetOutputFile(perfHistoFile);
816  perf->SetTracker(tracker);
817  std::cout << "Loading Monte-Carlo Data for Event " << kEvents << "..." << std::endl;
818  if (!perf->ReadDataFromFiles(fileName)) {
819  cout << "Monte-Carlo Data for Event " << kEvents << " can't be read." << std::endl;
820  break;
821  }
822 
823  perf->CombineHits();
824  }
825 #endif
826 
827  // cout<<"Run trackfinder .. "<<endl;
828 
829  tracker->FindTracks();
830 
831  // Write output
832  {
833  int nOutTracks=0;
834  for( int itr=0; itr<tracker->NTracks(); itr++){
835  const PndCAGBTrack &tr = tracker->Track( itr );
836  //cout<<"Output track:"<<endl;
837  PndTrackCand outCand;
838  for( int ih=0; ih<tr.NHits(); ih++ ){
839  int hitIndex = tracker->TrackHit( tr.FirstHitRef() + ih );
840  const PndCAGBHit &hit = tracker->Hit( hitIndex );
841  if( hit.PndDetID()==24 ) cout<<hit.PndDetID()<<" "<<hit.PndHitID()<<endl;
842  outCand.AddHit( hit.PndDetID(), hit.PndHitID(), hit.IRow() );
843  }
844  outCand.setMcTrackId(-1);
845  //float x,y,z,px,py,pz,cov[21];
846  //tr.Param().GetXYZPxPyPz( x,y,z,px,py,pz,cov);
847 
848  FairTrackParP paramFirst;
849  FairTrackParP paramLast;
850 
851  CATrackParToFairTrackParP( &paramFirst, &tr.InnerParam() );
852  CATrackParToFairTrackParP( &paramLast, &tr.OuterParam() );
853 
854  //PndTrack tmp(paramFirst,paramLast,outCand);
855  //tmp.Print();
856  PndTrack *outTrack = new((*fSttMvdPndTrackArray)[nOutTracks]) PndTrack(paramFirst,paramLast,outCand);
857  outTrack->SetRefIndex(nOutTracks);
858  outTrack->SetFlag(0);
859  nOutTracks++;
860  }
861  }
862 
863 #ifdef DO_TPCCATRACKER_EFF_PERFORMANCE
864  if ( fDoPerformance && perf ) {
865  cout<<"Run performance.. "<<endl;
866  //SG!!! tracker->SaveTracksInFile(fileName);
867  if (trackerConst->NHits() > 0) {
868  perf->InitSubPerformances();
869  perf->ExecPerformance();
870  }
871  else {
872  cout << "Event " << kEvents << " contains 0 hits." << std::endl;
873  }
874  }
875 #endif
876 
877  if (fVerbose>0){
878 
879  const bool ifAvarageTime = 1;
880  if (!ifAvarageTime){
881  std::cout << "Reconstruction Time"
882  << " Real = " << std::setw( 10 ) << (trackerConst->SliceTrackerTime() + trackerConst->StatTime( 9 )) * 1.e3 << " ms,"
883  << " CPU = " << std::setw( 10 ) << (trackerConst->SliceTrackerCpuTime() + trackerConst->StatTime( 10 )) * 1.e3 << " ms"
884  << std::endl;
885  }
886  else{
887  const int NTimers = trackerConst->NTimers();
888  static int statIEvent = 0;
889  static double *statTime = new double[NTimers];
890  static double statTime_SliceTrackerTime = 0;
891  static double statTime_SliceTrackerCpuTime = 0;
892 
893  if (!statIEvent){
894  for (int i = 0; i < NTimers; i++){
895  statTime[i] = 0;
896  }
897  }
898 
899  statIEvent++;
900  for (int i = 0; i < NTimers; i++){
901  statTime[i] += trackerConst->StatTime( i );
902  }
903  statTime_SliceTrackerTime += trackerConst->SliceTrackerTime();
904  statTime_SliceTrackerCpuTime += trackerConst->SliceTrackerCpuTime();
905 
906  std::cout << "Reconstruction Time"
907  << " Real = " << std::setw( 10 ) << 1./statIEvent*(statTime_SliceTrackerTime+statTime[ 9 ]) * 1.e3 << " ms,"
908  << " CPU = " << std::setw( 10 ) << 1./statIEvent*(statTime_SliceTrackerCpuTime+statTime[ 10 ]) * 1.e3 << " ms,"
909  << std::endl;
910  }
911  } // fVerbose>0
912 
913  } while(0);
914 
915  delete tracker;
916 }
TClonesArray * fSttMvdPndTrackArray
Definition: PndCATracking.h:83
Double_t CR[11]
int fVerbose
Definition: poormantracks.C:24
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
void SetRefIndex(TString branch, Int_t i)
Definition: PndTrack.h:41
double r
Definition: RiemannTest.C:14
void SetGlobalX(float v)
Definition: PndCAGBHit.h:77
const PndCAGBHit & Hit(int index) const
int IRow() const
Definition: PndCAGBHit.h:57
Int_t GetTubeID()
Definition: PndSttPoint.h:77
Int_t i
Definition: run_full.C:25
Double_t GetHalfLength()
Definition: PndSttTube.cxx:99
int NTimers() const
int FirstHitRef() const
Definition: PndCAGBTrack.h:31
exit(0)
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
Int_t GetPdgCode() const
Definition: PndMCTrack.h:73
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
int PndHitID() const
Definition: PndCAGBHit.h:74
void setMcTrackId(int i)
Definition: PndTrackCand.h:72
const PndCATrackParam & OuterParam() const
Definition: PndCAGBTrack.h:34
static void CATrackParToFairTrackParP(FairTrackParP *fairParam, const PndCATrackParam *caParam)
TVector3 GetMomentum() const
Definition: PndMCTrack.h:78
void SetYW(float v)
Definition: PndCAGBHit.h:99
#define pi
Definition: createSTT.C:60
cout<< "POINTs for new FwEndCap == "<< tsim-> GetEntriesFast()
void SetTubeR(float v)
Definition: PndCAGBHit.h:102
TGeoManager * gGeoManager
Int_t GetSensorID() const
Definition: PndSdsMCPoint.h:89
double StatTime(int iTimer) const
int TrackHit(int i) const
Double_t p
Definition: anasim.C:58
bool compareSttPoints(PndSttPoint *const a, PndSttPoint *const b)
Double_t GetRadIn()
Definition: PndSttTube.cxx:93
void SetGlobalY(float v)
Definition: PndCAGBHit.h:78
void SetBz(float v)
Definition: PndCAParam.h:51
vector< PndSdsMCPoint * > MvdArray
int Pic_FED Eff_lEE C()
static T Abs(const T &x)
Definition: PndCAMath.h:39
const PndCAGBTrack & Track(int i) const
void SetZW(float v)
Definition: PndCAGBHit.h:100
TClonesArray * fMvdPixelHitsArray
Definition: PndCATracking.h:65
void AddHit(UInt_t detId, UInt_t hitId, Double_t rho)
double SliceTrackerTime() const
int nHits
Definition: RiemannTest.C:16
void SetPndDetID(int v)
Definition: PndCAGBHit.h:111
void SetC(float v, int i1, int i2)
Definition: PndCAGBHit.h:105
Double_t GetIsochrone() const
Definition: PndSttHit.h:62
Double_t
TClonesArray * fMCTrackArray
Definition: PndCATracking.h:75
void SetR(float v)
Definition: PndCAGBHit.h:94
TVector3 GetPosition()
Definition: PndSttTube.cxx:87
TClonesArray * point
Definition: anaLmdDigi.C:29
int NHits() const
TFile * f
Definition: bump_analys.C:12
Int_t GetTubeID() const
Definition: PndSttHit.h:75
void SetZ(float v)
Definition: PndCAGBHit.h:79
Double_t GetIsochroneError() const
Definition: PndSttHit.h:63
Double_t z
TClonesArray * fSttPointsArray
Definition: PndCATracking.h:74
void SetAngle(float v)
Definition: PndCAGBHit.h:91
TClonesArray * fMvdPointsArray
Definition: PndCATracking.h:73
int PndDetID() const
Definition: PndCAGBHit.h:73
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
TFile * out
Definition: reco_muo.C:20
void SetHits(std::vector< PndCAGBHit > &hits)
TString fSttHitsBranchName
Definition: PndCATracking.h:58
static PndGeoHandling * Instance()
void SetTubeHalfLength(float v)
Definition: PndCAGBHit.h:103
PndCAParam & GetParametersNonConst()
void SetID(int v)
Definition: PndCAGBHit.h:84
TClonesArray * fSttHitsArray
Definition: PndCATracking.h:71
int NTracks() const
bool compareSdsPoints(PndSdsMCPoint *const a, PndSdsMCPoint *const b)
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
Double_t x
void SetXW(float v)
Definition: PndCAGBHit.h:98
void WriteMVDHits(std::vector< PndCAGBHit > &vHits, std::fstream &outH, std::fstream &outHL, std::fstream &outMCT, std::fstream &outMCP, int &iHit, map< int, unsigned int > &nHitsInMCTrack, bool isPixel)
return buf
void SetIRow(int v)
Definition: PndCAGBHit.h:83
double SliceTrackerCpuTime() const
void SetErr2R(float v)
Definition: PndCAGBHit.h:95
Double_t y
TVector3 GetStartVertex() const
Definition: PndMCTrack.h:76
TClonesArray * fTubeArray
Definition: PndCATracking.h:78
Int_t GetMotherID() const
Definition: PndMCTrack.h:74
int NHits() const
Definition: PndCAGBTrack.h:30
Double_t Pi
TClonesArray * fMvdStripHitsArray
Definition: PndCATracking.h:66
const PndCATrackParam & InnerParam() const
Definition: PndCAGBTrack.h:33
TMatrixT< Double_t > GetRotationMatrix()
Definition: PndSttTube.cxx:90
TVector3 GetWireDirection()
Definition: PndSttTube.cxx:107
void SetPndHitID(int v)
Definition: PndCAGBHit.h:112
double pz[39]
Definition: pipisigmas.h:14
void ReadSettings(std::istringstream &in)
void PndCATracking::Finish ( )
virtual

Definition at line 919 of file PndCATracking.cxx.

References fDoPerformance.

920 {
921 #ifdef DO_TPCCATRACKER_EFF_PERFORMANCE
922  if ( fDoPerformance && perf ) {
923  perf->WriteHistos();
924  }
925  //perfHistoFile->Close();
926 #endif
927 }
Bool_t PndPersistencyTask::GetPersistency ( )
inlineinherited

Definition at line 32 of file PndPersistencyTask.h.

References PndPersistencyTask::fPersistency.

Referenced by PndLmdPixelHitProducerFast::GetPersistance(), PndMdtDigitization::Init(), PndMdtHitProducerIdeal::Init(), PndMdtClusterTask::Init(), PndFtsHitProducerRealFast::Init(), PndSttHitProducerRealFast::Init(), PndDiscTaskReconstruction::Init(), PndRichHitProducer::Init(), PndSttHelixHitProducer::Init(), PndDiscTaskPID::Init(), PndIdealTrackFinder::Init(), PndSttMvdGemTracking::Init(), PndMdtTrkProducer::Init(), PndFtsHitProducerRealFull::Init(), PndLmdPixelClusterTask::Init(), PndSttHitProducerRealFull::Init(), PndLmdStripClusterTask::Init(), PndEmcApdHitProducer::Init(), PndMissingPzCleanerTask::Init(), PndEmcMakeRecoHit::Init(), PndEmcMakeClusterOnline::Init(), PndTrackSmearTask::Init(), PndEmcFWEndcapTimebasedWaveforms::Init(), PndSttHitProducerIdeal::Init(), PndEmcFWEndcapDigi::Init(), PndFtsHitProducerIdeal::Init(), PndEmcMakeCluster::Init(), PndMdtPointsToWaveform::Init(), PndDiscTaskDigitization::Init(), PndEmcMakeDigi::Init(), PndSdsTimeWalkCorrTask::Init(), PndLmdPixelHitProducerFast::Init(), PndDrcHitFinder::Init(), PndRichHitFinder::Init(), PndEmcMakeCorr::Init(), PndFtofHitProducerIdeal::Init(), PndEmcHitsToWaveform::Init(), PndSciTDigiTask::Init(), PndDrcHitProducerIdeal::Init(), PndSdsHitProducerIdeal::Init(), PndSciTHitProducerIdeal::Init(), PndRecoMultiKalmanTask2::Init(), PndEmcHitProducer::Init(), PndDrcHitProducerReal::Init(), PndDskFLGHitProducerIdeal::Init(), PndEmcTmpWaveformToDigi::Init(), PndDrcDigiTask::Init(), PndEmcWaveformToDigi::Init(), PndSttMatchTracks::Init(), PndEmcWaveformToCalibratedDigi::Init(), PndTrkTracking2::Init(), PndSttFindTracks::Init(), PndEmcMultiWaveformToCalibratedDigi::Init(), PndRecoKalmanTask2::Init(), PndDrcTimeDigiTask::Init(), PndEmcExpClusterSplitter::Init(), PndFtsHoughTrackerTask::Init(), PndSdsNoiseProducer::Init(), PndEmcPhiBumpSplitter::Init(), PndSdsIdealRecoTask::Init(), PndSdsHybridHitProducer::Init(), PndRecoMultiKalmanTask::Init(), PndSdsIdealClusterTask::Init(), PndRecoKalmanTask::Init(), PndSdsStripHitProducerDif::Init(), PndGemDigitize::Init(), PndSdsStripHitProducer::Init(), PndGemFindHits::Init(), PndSdsPixelClusterTask::Init(), PndSdsStripClusterTask::Init(), PndMvdGemTrackFinderOnHits::Init(), PndBarrelTrackFinder::Init(), PndEmcFullDigiTask::PndEmcFullDigiTask(), PndEmcMakeBump::PndEmcMakeBump(), PndUnassignedHitsTask::RegisterBranches(), PndMvdClusterTask::SetPersistance(), PndMvdDigiTask::SetPersistance(), PndEmcMakeBump::SetStorageOfData(), and PndEmcFullDigiTask::StoreDigi().

32 { return fPersistency; }
InitStatus PndCATracking::Init ( )
virtual

Definition at line 89 of file PndCATracking.cxx.

References PndSttMapCreator::FillTubeArray(), fMCTrackArray, fMCTracksBranchName, fMvdPixelClusterArray, fMvdPixelClusterBranchName, fMvdPixelDigiArray, fMvdPixelDigiBranchName, fMvdPixelHitsArray, fMvdPixelHitsBranchName, fMvdPointsArray, fMvdPointsBranchName, fMvdStripClusterArray, fMvdStripClusterBranchName, fMvdStripDigiArray, fMvdStripDigiBranchName, fMvdStripHitsArray, fMvdStripHitsBranchName, fSttHitsArray, fSttHitsBranchName, fSttMvdPndTrackArray, fSttPointsArray, fSttPointsBranchName, fTubeArray, PndGeoSttPar::GetGeometryType(), and rtdb.

90 {
91  perf = &PndCAPerformance::Instance();
92 
93  //Get ROOT Manager
94  FairRootManager* ioman= FairRootManager::Instance();
95 
96  if(ioman==0)
97  {
98  Error("PndCATracking::Init","RootManager not instantiated!");
99  return kERROR;
100  }
101 
102  // Get Hits
103  // MVD Pixel Hits
104  fMvdPixelHitsArray=(TClonesArray*) ioman->GetObject(fMvdPixelHitsBranchName);
105  if(fMvdPixelHitsArray==0)
106  {
107  Error("PndCATracking::Init","mvd pixel hit array not found!");
108  return kERROR;
109  }
110  //MVD Strip Hits
111  fMvdStripHitsArray=(TClonesArray*) ioman->GetObject(fMvdStripHitsBranchName);
112  if(fMvdStripHitsArray==0)
113  {
114  Error("PndCATracking::Init","mvd strip hit array not found!");
115  return kERROR;
116  }
117  //STT hits
118  fSttHitsArray=(TClonesArray*) ioman->GetObject(fSttHitsBranchName);
119  if(fSttHitsArray==0)
120  {
121  Error("PndCATracking::Init","stt hit array not found!");
122  return kERROR;
123  }
124 
125  // MVD Pixel Clusters
126  fMvdPixelClusterArray=(TClonesArray*) ioman->GetObject(fMvdPixelClusterBranchName);
127  if(fMvdPixelClusterArray==0)
128  {
129  Error("PndCATracking::Init","mvd pixel cluster array not found!");
130  return kERROR;
131  }
132  //MVD Strip Clusters
133  fMvdStripClusterArray=(TClonesArray*) ioman->GetObject(fMvdStripClusterBranchName);
134  if(fMvdStripClusterArray==0)
135  {
136  Error("PndCATracking::Init","mvd strip cluster array not found!");
137  return kERROR;
138  }
139 
140  // MVD Pixel Digis
141  fMvdPixelDigiArray=(TClonesArray*) ioman->GetObject(fMvdPixelDigiBranchName);
142  if(fMvdPixelDigiArray==0)
143  {
144  Error("PndCATracking::Init","mvd pixel digi array not found!");
145  return kERROR;
146  }
147  //MVD Strip Digis
148  fMvdStripDigiArray=(TClonesArray*) ioman->GetObject(fMvdStripDigiBranchName);
149  if(fMvdStripDigiArray==0)
150  {
151  Error("PndCATracking::Init","mvd strip digi array not found!");
152  return kERROR;
153  }
154 
155  //STT points
156  fSttPointsArray=(TClonesArray*) ioman->GetObject(fSttPointsBranchName);
157  if(fSttPointsArray==0)
158  {
159  Error("PndCATracking::Init","sts points array not found!");
160  return kERROR;
161  }
162 
163  //MVD points
164  fMvdPointsArray=(TClonesArray*) ioman->GetObject(fMvdPointsBranchName);
165  if(fMvdPointsArray==0)
166  {
167  Error("PndCATracking::Init","mvd points array not found!");
168  return kERROR;
169  }
170 
171  //MC Tracks
172  fMCTrackArray=(TClonesArray*) ioman->GetObject(fMCTracksBranchName);
173  if(fMCTrackArray==0)
174  {
175  Error("PndCATracking::Init","mc tracks array not found!");
176  return kERROR;
177  }
178 
179  //STT tube geometry
180  FairRuntimeDb* rtdb = FairRunAna::Instance()->GetRuntimeDb();
181  PndGeoSttPar *sttParameters = (PndGeoSttPar*) rtdb->getContainer("PndGeoSttPar");
182 
183  if(sttParameters->GetGeometryType() != -1) {
184  PndSttMapCreator *mapper = new PndSttMapCreator(sttParameters);
185  fTubeArray = mapper->FillTubeArray();
186  }
187 
188  //-------------------------------- output TClonesArrays ------------------------
189 
190 
191  // Create and register output array for PndTrack of Stt+Mvd combined
192 
193  fSttMvdPndTrackArray = new TClonesArray("PndTrack");
194  ioman->Register("SttMvdTrack","SttMvd",fSttMvdPndTrackArray, kTRUE);
195 
196  //-----------------------
197 
198 
199  return kSUCCESS;
200 }
TClonesArray * fSttMvdPndTrackArray
Definition: PndCATracking.h:83
TString fMvdPointsBranchName
Definition: PndCATracking.h:60
TString fMCTracksBranchName
Definition: PndCATracking.h:62
TClonesArray * fMvdPixelDigiArray
Definition: PndCATracking.h:69
Int_t GetGeometryType()
Definition: PndGeoSttPar.h:28
TString fMvdPixelDigiBranchName
Definition: PndCATracking.h:56
TClonesArray * fMvdPixelHitsArray
Definition: PndCATracking.h:65
TString fSttPointsBranchName
Definition: PndCATracking.h:61
TClonesArray * fMCTrackArray
Definition: PndCATracking.h:75
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
TClonesArray * FillTubeArray()
TString fMvdStripDigiBranchName
Definition: PndCATracking.h:57
TClonesArray * fSttPointsArray
Definition: PndCATracking.h:74
TClonesArray * fMvdPointsArray
Definition: PndCATracking.h:73
TString fSttHitsBranchName
Definition: PndCATracking.h:58
TClonesArray * fMvdStripDigiArray
Definition: PndCATracking.h:70
TString fMvdStripHitsBranchName
Definition: PndCATracking.h:53
TClonesArray * fSttHitsArray
Definition: PndCATracking.h:71
TClonesArray * fMvdPixelClusterArray
Definition: PndCATracking.h:67
TString fMvdStripClusterBranchName
Definition: PndCATracking.h:55
TString fMvdPixelClusterBranchName
Definition: PndCATracking.h:54
TClonesArray * fMvdStripClusterArray
Definition: PndCATracking.h:68
TClonesArray * fTubeArray
Definition: PndCATracking.h:78
TString fMvdPixelHitsBranchName
Definition: PndCATracking.h:52
TClonesArray * fMvdStripHitsArray
Definition: PndCATracking.h:66
static PndCAPerformance& PndCATracking::Instance ( )
static

Instance.

void PndCATracking::SetMvdPixelHitsBranchName ( const TString name)
inline

Definition at line 41 of file PndCATracking.h.

References fMvdPixelHitsBranchName, and name.

TString name
TString fMvdPixelHitsBranchName
Definition: PndCATracking.h:52
void PndCATracking::SetMvdStripHitsBranchName ( const TString name)
inline

Definition at line 42 of file PndCATracking.h.

References fMvdStripHitsBranchName, and name.

TString name
TString fMvdStripHitsBranchName
Definition: PndCATracking.h:53
void PndCATracking::SetParContainers ( )

Definition at line 202 of file PndCATracking.cxx.

References fGeoH, PndGeoHandling::Instance(), rtdb, and PndGeoHandling::SetParContainers().

202  {
203  FairRuntimeDb* rtdb = FairRunAna::Instance()->GetRuntimeDb();
204  rtdb->getContainer("PndGeoSttPar");
205  rtdb->getContainer("PndGeoFtsPar");
206 
207  // for MVD geometry extraction
210 }
virtual void SetParContainers()
PndGeoHandling * fGeoH
Definition: PndCATracking.h:80
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
static PndGeoHandling * Instance()
void PndPersistencyTask::SetPersistency ( Bool_t  val = kTRUE)
inlineinherited

Definition at line 31 of file PndPersistencyTask.h.

References PndPersistencyTask::fPersistency, and val.

Referenced by barrelTrackFinder(), digi_complete(), digi_complete_newSTT(), digiOnly_complete(), PndBarrelTrackFinder::PndBarrelTrackFinder(), PndCATracking(), PndDrcHitFinder::PndDrcHitFinder(), PndEmc2DLocMaxFinder::PndEmc2DLocMaxFinder(), PndEmcExpClusterSplitter::PndEmcExpClusterSplitter(), PndEmcFullDigiTask::PndEmcFullDigiTask(), PndEmcFWEndcapDigi::PndEmcFWEndcapDigi(), PndEmcFWEndcapTimebasedWaveforms::PndEmcFWEndcapTimebasedWaveforms(), PndEmcHitProducer::PndEmcHitProducer(), PndEmcHitsToWaveform::PndEmcHitsToWaveform(), PndEmcMakeBump::PndEmcMakeBump(), PndEmcMakeCluster::PndEmcMakeCluster(), PndEmcMakeClusterOnline::PndEmcMakeClusterOnline(), PndEmcMakeDigi::PndEmcMakeDigi(), PndEmcMakeRecoHit::PndEmcMakeRecoHit(), PndEmcMultiWaveformToCalibratedDigi::PndEmcMultiWaveformToCalibratedDigi(), PndEmcPhiBumpSplitter::PndEmcPhiBumpSplitter(), PndEmcTmpWaveformToDigi::PndEmcTmpWaveformToDigi(), PndEmcWaveformToCalibratedDigi::PndEmcWaveformToCalibratedDigi(), PndEmcWaveformToDigi::PndEmcWaveformToDigi(), PndFtofHitProducerIdeal::PndFtofHitProducerIdeal(), PndFtsCATracking::PndFtsCATracking(), PndFtsHitProducerIdeal::PndFtsHitProducerIdeal(), PndFtsHitProducerRealFast::PndFtsHitProducerRealFast(), PndFtsHitProducerRealFull::PndFtsHitProducerRealFull(), PndFtsHoughTrackerTask::PndFtsHoughTrackerTask(), PndGemDigitize::PndGemDigitize(), PndGemFindHits::PndGemFindHits(), PndIdealTrackFinder::PndIdealTrackFinder(), PndLmdPixelClusterTask::PndLmdPixelClusterTask(), PndLmdPixelHitProducerFast::PndLmdPixelHitProducerFast(), PndMdtClusterTask::PndMdtClusterTask(), PndMdtDigitization::PndMdtDigitization(), PndMdtHitProducerIdeal::PndMdtHitProducerIdeal(), PndMdtPointsToWaveform::PndMdtPointsToWaveform(), PndMdtTrkProducer::PndMdtTrkProducer(), PndMissingPzCleanerTask::PndMissingPzCleanerTask(), PndMvdGemTrackFinderOnHits::PndMvdGemTrackFinderOnHits(), PndMvdHitProducerIdeal::PndMvdHitProducerIdeal(), PndMvdPixelClusterTask::PndMvdPixelClusterTask(), PndMvdTimeWalkCorrTask::PndMvdTimeWalkCorrTask(), PndMvdToPix4ClusterTask::PndMvdToPix4ClusterTask(), PndRecoKalmanTask::PndRecoKalmanTask(), PndRecoKalmanTask2::PndRecoKalmanTask2(), PndRecoMultiKalmanTask::PndRecoMultiKalmanTask(), PndRecoMultiKalmanTask2::PndRecoMultiKalmanTask2(), PndRichHitFinder::PndRichHitFinder(), PndRichHitProducer::PndRichHitProducer(), PndSciTDigiTask::PndSciTDigiTask(), PndSciTHitProducerIdeal::PndSciTHitProducerIdeal(), PndSdsHitProducerIdeal::PndSdsHitProducerIdeal(), PndSdsHybridHitProducer::PndSdsHybridHitProducer(), PndSdsIdealClusterTask::PndSdsIdealClusterTask(), PndSdsIdealRecoTask::PndSdsIdealRecoTask(), PndSdsNoiseProducer::PndSdsNoiseProducer(), PndSdsPixelClusterTask::PndSdsPixelClusterTask(), PndSdsStripClusterTask::PndSdsStripClusterTask(), PndSdsStripHitProducer::PndSdsStripHitProducer(), PndSdsTimeWalkCorrTask::PndSdsTimeWalkCorrTask(), PndSttFindTracks::PndSttFindTracks(), PndSttHelixHitProducer::PndSttHelixHitProducer(), PndSttHitProducerIdeal::PndSttHitProducerIdeal(), PndSttHitProducerRealFast::PndSttHitProducerRealFast(), PndSttHitProducerRealFull::PndSttHitProducerRealFull(), PndSttMatchTracks::PndSttMatchTracks(), PndSttMvdGemTracking::PndSttMvdGemTracking(), PndTrackSmearTask::PndTrackSmearTask(), PndTrkTracking2::PndTrkTracking2(), reco(), reco_complete(), reco_complete_gf2(), reco_complete_newSTT(), reco_complete_sec(), recoideal_complete(), PndMvdClusterTask::SetPersistance(), PndMvdDigiTask::SetPersistance(), PndLmdPixelHitProducerFast::SetPersistance(), PndSdsHitProducerIdeal::SetPersistance(), PndSttMvdGemTracking::SetPersistenc(), PndMdtClusterTask::SetPersistence(), PndSttHelixHitProducer::SetPersistence(), PndMissingPzCleanerTask::SetPersistence(), PndFtsHitProducerRealFast::SetPersistence(), PndFtsHitProducerRealFull::SetPersistence(), PndSttHitProducerRealFull::SetPersistence(), PndSttHitProducerIdeal::SetPersistence(), PndSttHitProducerRealFast::SetPersistence(), PndFtsHitProducerIdeal::SetPersistence(), PndTrackSmearTask::SetPersistence(), PndSciTHitProducerIdeal::SetPersistence(), PndIdealTrackFinder::SetPersistence(), PndSttMatchTracks::SetPersistence(), PndSttFindTracks::SetPersistence(), PndFtsHoughTrackerTask::SetPersistence(), PndTrkTracking2::SetPersistence(), PndEmcMakeRecoHit::SetStorageOfData(), PndEmcFWEndcapDigi::SetStorageOfData(), PndEmcMakeClusterOnline::SetStorageOfData(), PndEmcFWEndcapTimebasedWaveforms::SetStorageOfData(), PndEmcMakeDigi::SetStorageOfData(), PndMdtPointsToWaveform::SetStorageOfData(), PndEmc2DLocMaxFinder::SetStorageOfData(), PndEmcMakeCluster::SetStorageOfData(), PndEmcHitsToWaveform::SetStorageOfData(), PndEmcMakeBump::SetStorageOfData(), PndEmcTmpWaveformToDigi::SetStorageOfData(), PndEmcWaveformToDigi::SetStorageOfData(), PndEmcWaveformToCalibratedDigi::SetStorageOfData(), PndEmcMultiWaveformToCalibratedDigi::SetStorageOfData(), PndEmcExpClusterSplitter::SetStorageOfData(), PndEmcPhiBumpSplitter::SetStorageOfData(), standard_tracking(), and PndEmcFullDigiTask::StoreDigi().

31 { fPersistency = val; }
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
void PndCATracking::SetSttHitsBranchName ( const TString name)
inline

Definition at line 43 of file PndCATracking.h.

References fSttHitsBranchName, and name.

TString fSttHitsBranchName
Definition: PndCATracking.h:58
TString name
void PndCATracking::WriteMVDHits ( std::vector< PndCAGBHit > &  vHits,
std::fstream &  outH,
std::fstream &  outHL,
std::fstream &  outMCT,
std::fstream &  outMCP,
int &  iHit,
map< int, unsigned int > &  nHitsInMCTrack,
bool  isPixel 
)
private

Definition at line 932 of file PndCATracking.cxx.

References CAMath::ASin(), CR, digi, Double_t, fabs(), fDoPerformance, fMvdPixelClusterArray, fMvdPixelDigiArray, fMvdPixelHitsArray, fMvdPixelHitsBranchName, fMvdPointsArray, fMvdStripClusterArray, fMvdStripDigiArray, fMvdStripHitsArray, fMvdStripHitsBranchName, PndSdsHit::GetClusterIndex(), PndSdsCluster::GetClusterSize(), PndSdsHit::GetCov(), PndSdsCluster::GetDigiIndex(), PndSdsDigi::GetIndices(), PndSdsHit::GetPosition(), PndSdsHit::GetSensorID(), gGeoManager, h, PndGeoHandling::Instance(), Pi, point, r, PndCAGBHit::SetAngle(), PndCAGBHit::SetC(), PndCAGBHit::SetErr2R(), PndCAGBHit::SetGlobalX(), PndCAGBHit::SetGlobalY(), PndCAGBHit::SetID(), PndCAGBHit::SetIRow(), PndCAGBHit::SetPndDetID(), PndCAGBHit::SetPndHitID(), PndCAGBHit::SetR(), PndCAGBHit::SetTubeHalfLength(), PndCAGBHit::SetTubeR(), PndCAGBHit::SetXW(), PndCAGBHit::SetYW(), PndCAGBHit::SetZ(), PndCAGBHit::SetZW(), CAMath::Sqrt(), x, y, and z.

Referenced by Exec().

934 {
935  TClonesArray *mvdHitsArray;
936  if(isPixel) mvdHitsArray = fMvdPixelHitsArray;
937  else mvdHitsArray = fMvdStripHitsArray;
938  for(int iHMvd=0; iHMvd<mvdHitsArray->GetEntriesFast(); iHMvd++)
939  {
940  PndSdsHit* currenthit = (PndSdsHit*) mvdHitsArray->At(iHMvd);
941 
942  Int_t sensorID = currenthit->GetSensorID();
943  gGeoManager->cd(PndGeoHandling::Instance()->GetPath(sensorID));
944  TGeoHMatrix* transMat = gGeoManager->GetCurrentMatrix();
945  Double_t *mmm = transMat->GetRotationMatrix();
946  /*
947  if( isPixel ){
948  cout<<"sensor "<<sensorID<<endl;
949  cout<<" "<<mmm[0]<<" "<<mmm[1]<<" "<<mmm[2]<<endl;
950  cout<<" "<<mmm[3]<<" "<<mmm[4]<<" "<<mmm[5]<<endl;
951  cout<<" "<<mmm[6]<<" "<<mmm[7]<<" "<<mmm[8]<<endl;
952  }
953  */
954  Double_t A = 0;
955 
956  TVector3 position = currenthit->GetPosition();
957  Double_t x = position.X();
958  Double_t y = position.Y();
959  Double_t z = position.Z();
960  //cout<<x<<" "<<y<<" "<<z<<endl;
961  Double_t r = TMath::Sqrt(x*x + y*y);
962  int iSta = -1;
963  /*
964  Double_t *mTrans = transMat->GetTranslation();
965  cout<<"sensor "<<sensorID<<", pixel "<<isPixel<<endl;
966  cout<<"trans "<<mTrans[0]<<" "<<mTrans[1]<<" "<<mTrans[2]<<endl;
967  for( int i=0; i<3; i++){
968  for( int j=0; j<3; j++){
969  cout<<mmm[i*3+j]<<" ";
970  }
971  cout<<endl;
972  }
973  cout<<"xyz "<<x<<" "<<y<<" "<<z<<endl;
974  */
975 
976  // get station angle A and station index iSta
977 
978  if( fabs(mmm[6]) < 0.999 && fabs(mmm[7]) < 0.999 ) continue;
979  if( fabs(mmm[6]) < 0.999 && fabs(mmm[7]) < 0.999 ){ // forward detector, perpendicular to beam axis Z
980  //cout<<"forward detector!!??"<<endl;
981  //Double_t sinA = mmm[2];
982  //cout << "angle "<<TMath::ASin(sinA)<<endl;
983  A=1234;
984  if( (z>0.) && (z<3.) ) iSta = 0;
985  if( (z>3.) && (z<5.5) ) iSta = 1;
986  if( (z>5.5) && (z<8.0) ) iSta = 2;
987  if( (z>8.0) && (z<12.0) ) iSta = 3;
988  if( (z>12.0) && (z<18.5) ) iSta = 4;
989  if( (z>18.5) && (z<24.5) ) iSta = 5;
990  } else {
991  //cout<<" phi detector"<<endl;
992  if( fabs(mmm[6]) > 0.999 ){
993  if( currenthit->GetPosition().Y()>=0 ){
994  Double_t sinA = mmm[2];
995  A = TMath::ASin(sinA);
996  } else {
997  Double_t sinA = -mmm[2];
998  A = TMath::ASin(sinA)-TMath::Pi();
999  }
1000  }
1001  if( fabs(mmm[7]) > 0.999 ){
1002  if( currenthit->GetPosition().Y()>=0 ){
1003  Double_t sinA = -mmm[2];
1004  A = TMath::ASin(sinA);
1005  } else {
1006  Double_t sinA = mmm[2];
1007  A = TMath::ASin(sinA)+TMath::Pi();
1008  }
1009  }
1010  if( (r>0.) && (r<3.5) ) iSta = 0;//2;
1011  if( (r>3.5) && (r<7.5) ) iSta = 1;//3;
1012  if( (r>7.5) && (r<11.0) ) iSta = 2;//4;
1013  if( (r>11.0) && (r<15.0) ) iSta = 3;//5;
1014  }
1015 
1016  TMatrixT<Double_t> RM(3,3,mmm);
1017  TMatrixT<Double_t> CR = currenthit->GetCov(); // rotated CovMatrix
1018 
1019 // CR = RM*CR;
1020 // CR = CR*RM.Transpose(RM);
1021 
1022  Double_t radius= 0;
1023 
1024  // error calculation according to the curve chosen by flag
1025  Double_t closestDistanceError = 0;
1026 
1027  int clusterID = currenthit->GetClusterIndex();
1028  PndSdsCluster* cluster;
1029  if(isPixel)
1030  cluster = (PndSdsClusterPixel*) fMvdPixelClusterArray->At(clusterID);
1031  else
1032  cluster = (PndSdsClusterStrip*) fMvdStripClusterArray->At(clusterID);
1033  int digiID = -1;
1034  vector<int> trackID;
1035 
1036  for(int iD=0; iD < cluster->GetClusterSize(); iD++)
1037  {
1038  digiID = cluster->GetDigiIndex(iD);
1039  if(digiID < 0) continue;
1040  PndSdsDigi* digi;
1041  if(isPixel)
1042  digi = (PndSdsDigiPixel*) fMvdPixelDigiArray->At(digiID);
1043  else
1044  digi = (PndSdsDigiStrip*) fMvdStripDigiArray->At(digiID);
1045 
1046  int pointID = -1;
1047  for(unsigned int iP=0; iP<digi->GetIndices().size(); iP++)
1048  {
1049  pointID = digi->GetIndices()[iP];
1050  if(pointID<0) continue;
1051  PndSdsMCPoint* point = (PndSdsMCPoint*) fMvdPointsArray->At(pointID);
1052  int curTrID = point->GetTrackID();
1053  bool newID = 1;
1054  for(unsigned int iTr=0; iTr<trackID.size(); iTr++)
1055  if(trackID[iTr] == curTrID)
1056  {
1057  newID =0;
1058  break;
1059  }
1060  if(newID)
1061  trackID.push_back(curTrID);
1062 
1063  }
1064  }
1065  // cout<<" is pixel "<<isPixel<<" sta "<<iSta<<" r "<<r<<endl;
1066 
1067  //bool fwd = ( fabs(mmm[6]) < 0.999 && fabs(mmm[7]) < 0.999 );
1068  //if( isPixel ) cout<<"bla "<< fwd<<", "<<x<<", "<<y<<", "<<z<<", "<<r<<","<<endl;
1069  PndCAGBHit h;
1070  h.SetGlobalX( x );
1071  h.SetGlobalY( y );
1072  h.SetZ( z );
1073  h.SetXW(x);
1074  h.SetYW(y);
1075  h.SetZW(z);
1076 
1077  h.SetR( radius );
1078  h.SetC( CR );
1079  h.SetErr2R( closestDistanceError*closestDistanceError );
1080  h.SetIRow(iSta);
1081  h.SetID( iHit );
1082  if (isPixel)
1083  h.SetPndDetID( FairRootManager::Instance()->GetBranchId(fMvdPixelHitsBranchName) );
1084  else
1085  h.SetPndDetID( FairRootManager::Instance()->GetBranchId(fMvdStripHitsBranchName) );
1086  h.SetPndHitID( iHMvd );
1087  h.SetAngle( -A );
1088  h.SetTubeR( 0. );
1089  h.SetTubeHalfLength( 0. );
1090 
1091  vHits.push_back(h);
1092 
1093  int trackIDs[3] = {-1, -1, -1};
1094  if(trackID.size() > 0) trackIDs[0] = trackID[0];
1095  if(trackID.size() > 1) trackIDs[1] = trackID[1];
1096  if(trackID.size() > 2) trackIDs[2] = trackID[2];
1097 
1098  if( fDoPerformance ){
1099  outH << h;
1100  outHL << trackIDs[0] << " " << trackIDs[1] << " " << trackIDs[2] << endl;
1101  }
1102 
1103  /*
1104  outH << x << " " << y << " " << z << " " << radius << endl;
1105  outH << CR[0][0] << " " << CR[0][1] << " " << CR[0][2] << endl;
1106  outH << CR[1][0] << " " << CR[1][1] << " " << CR[1][2] << endl;
1107  outH << CR[2][0] << " " << CR[2][1] << " " << CR[2][2] << endl;
1108  outH << closestDistanceError*closestDistanceError << endl;
1109  outH << 0 << " " << 0 << endl;
1110  outH << 0 << " " << 0 << " " << 0 << endl;
1111  outH << iSta << " " << iHit << " " << A << endl;
1112  */
1113  iHit++;
1114 
1115  if ( nHitsInMCTrack.find(trackIDs[0]) != nHitsInMCTrack.end() ) {
1116  nHitsInMCTrack[trackIDs[0]]++;
1117  } else {
1118  nHitsInMCTrack[trackIDs[0]] = 1;
1119  }
1120  }
1121 }
static T ASin(const T &x)
Double_t CR[11]
TClonesArray * digi
Int_t GetClusterSize() const
Definition: PndSdsCluster.h:39
Base class for Digi information.
Definition: PndSdsDigi.h:29
double r
Definition: RiemannTest.C:14
void SetGlobalX(float v)
Definition: PndCAGBHit.h:77
TVector3 GetPosition() const
Definition: PndSdsHit.h:93
Class to store the Digis which belong to one cluster This class holds the information which Digi belo...
Definition: PndSdsCluster.h:19
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
Class for digitised strip hits.
void SetYW(float v)
Definition: PndCAGBHit.h:99
void SetTubeR(float v)
Definition: PndCAGBHit.h:102
TClonesArray * fMvdPixelDigiArray
Definition: PndCATracking.h:69
TGeoManager * gGeoManager
void SetGlobalY(float v)
Definition: PndCAGBHit.h:78
void SetZW(float v)
Definition: PndCAGBHit.h:100
TMatrixD GetCov() const
Definition: PndSdsHit.h:98
TClonesArray * fMvdPixelHitsArray
Definition: PndCATracking.h:65
Int_t GetDigiIndex(Int_t i) const
Definition: PndSdsCluster.h:40
void SetPndDetID(int v)
Definition: PndCAGBHit.h:111
void SetC(float v, int i1, int i2)
Definition: PndCAGBHit.h:105
Double_t
void SetR(float v)
Definition: PndCAGBHit.h:94
TClonesArray * point
Definition: anaLmdDigi.C:29
void SetZ(float v)
Definition: PndCAGBHit.h:79
Double_t z
void SetAngle(float v)
Definition: PndCAGBHit.h:91
TClonesArray * fMvdPointsArray
Definition: PndCATracking.h:73
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
static PndGeoHandling * Instance()
TClonesArray * fMvdStripDigiArray
Definition: PndCATracking.h:70
void SetTubeHalfLength(float v)
Definition: PndCAGBHit.h:103
TString fMvdStripHitsBranchName
Definition: PndCATracking.h:53
void SetID(int v)
Definition: PndCAGBHit.h:84
TClonesArray * fMvdPixelClusterArray
Definition: PndCATracking.h:67
std::vector< Int_t > GetIndices() const
Definition: PndSdsDigi.h:62
Double_t x
void SetXW(float v)
Definition: PndCAGBHit.h:98
void SetIRow(int v)
Definition: PndCAGBHit.h:83
Data class to store the digi output of a pixel module.
Int_t GetClusterIndex() const
Definition: PndSdsHit.h:94
TClonesArray * fMvdStripClusterArray
Definition: PndCATracking.h:68
void SetErr2R(float v)
Definition: PndCAGBHit.h:95
Double_t y
Int_t GetSensorID() const
Definition: PndSdsHit.h:90
TString fMvdPixelHitsBranchName
Definition: PndCATracking.h:52
Double_t Pi
TClonesArray * fMvdStripHitsArray
Definition: PndCATracking.h:66
void SetPndHitID(int v)
Definition: PndCAGBHit.h:112

Member Data Documentation

bool PndCATracking::fDoPerformance
private

Definition at line 92 of file PndCATracking.h.

Referenced by Exec(), Finish(), PndCATracking(), and WriteMVDHits().

PndGeoHandling* PndCATracking::fGeoH
private

Definition at line 80 of file PndCATracking.h.

Referenced by SetParContainers().

TClonesArray* PndCATracking::fMCTrackArray
private

Definition at line 75 of file PndCATracking.h.

Referenced by Exec(), and Init().

TString PndCATracking::fMCTracksBranchName
private

Definition at line 62 of file PndCATracking.h.

Referenced by Init().

TClonesArray* PndCATracking::fMvdPixelClusterArray
private

Definition at line 67 of file PndCATracking.h.

Referenced by Init(), and WriteMVDHits().

TString PndCATracking::fMvdPixelClusterBranchName
private

Definition at line 54 of file PndCATracking.h.

Referenced by Init().

TClonesArray* PndCATracking::fMvdPixelDigiArray
private

Definition at line 69 of file PndCATracking.h.

Referenced by Init(), and WriteMVDHits().

TString PndCATracking::fMvdPixelDigiBranchName
private

Definition at line 56 of file PndCATracking.h.

Referenced by Init().

TClonesArray* PndCATracking::fMvdPixelHitsArray
private

Definition at line 65 of file PndCATracking.h.

Referenced by Exec(), Init(), and WriteMVDHits().

TString PndCATracking::fMvdPixelHitsBranchName
private

Definition at line 52 of file PndCATracking.h.

Referenced by Init(), SetMvdPixelHitsBranchName(), and WriteMVDHits().

TClonesArray* PndCATracking::fMvdPointsArray
private

Definition at line 73 of file PndCATracking.h.

Referenced by Exec(), Init(), and WriteMVDHits().

TString PndCATracking::fMvdPointsBranchName
private

Definition at line 60 of file PndCATracking.h.

Referenced by Init().

TClonesArray* PndCATracking::fMvdStripClusterArray
private

Definition at line 68 of file PndCATracking.h.

Referenced by Init(), and WriteMVDHits().

TString PndCATracking::fMvdStripClusterBranchName
private

Definition at line 55 of file PndCATracking.h.

Referenced by Init().

TClonesArray* PndCATracking::fMvdStripDigiArray
private

Definition at line 70 of file PndCATracking.h.

Referenced by Init(), and WriteMVDHits().

TString PndCATracking::fMvdStripDigiBranchName
private

Definition at line 57 of file PndCATracking.h.

Referenced by Init().

TClonesArray* PndCATracking::fMvdStripHitsArray
private

Definition at line 66 of file PndCATracking.h.

Referenced by Exec(), Init(), and WriteMVDHits().

TString PndCATracking::fMvdStripHitsBranchName
private

Definition at line 53 of file PndCATracking.h.

Referenced by Init(), SetMvdStripHitsBranchName(), and WriteMVDHits().

TClonesArray* PndCATracking::fSttHitsArray
private

Definition at line 71 of file PndCATracking.h.

Referenced by Exec(), and Init().

TString PndCATracking::fSttHitsBranchName
private

Definition at line 58 of file PndCATracking.h.

Referenced by Exec(), Init(), and SetSttHitsBranchName().

TClonesArray* PndCATracking::fSttMvdPndTrackArray
private

Output array of PndSttMvd PndTrack

Definition at line 83 of file PndCATracking.h.

Referenced by Exec(), and Init().

TClonesArray* PndCATracking::fSttPointsArray
private

Definition at line 74 of file PndCATracking.h.

Referenced by Exec(), and Init().

TString PndCATracking::fSttPointsBranchName
private

Definition at line 61 of file PndCATracking.h.

Referenced by Init().

TClonesArray* PndCATracking::fTubeArray
private

Definition at line 78 of file PndCATracking.h.

Referenced by Exec(), and Init().


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