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

#include <PndSttHelixHitProducer.h>

Inheritance diagram for PndSttHelixHitProducer:
PndPersistencyTask

Public Member Functions

 PndSttHelixHitProducer ()
 
 PndSttHelixHitProducer (Int_t verbose)
 
 ~PndSttHelixHitProducer ()
 
virtual InitStatus Init ()
 
virtual void Exec (Option_t *opt)
 
void WriteHistograms ()
 
void SetPersistence (Bool_t persistence)
 
void SetParContainers ()
 
void SetPersistency (Bool_t val=kTRUE)
 
Bool_t GetPersistency ()
 

Private Member Functions

 ClassDef (PndSttHelixHitProducer, 1)
 

Private Attributes

TClonesArray * fPointArray
 
TClonesArray * fHitArray
 
TClonesArray * fTrackArray
 
TClonesArray * fTrackCandArray
 
TClonesArray * fHelixHitArray
 
TClonesArray * fTubeArray
 
TH1F * hx
 
TH1F * hy
 
TH1F * hz
 
TH1F * hxs
 
TH1F * hys
 
TH1F * hzs
 
TH2F * hzresvsslope
 
PndGeoSttParfSttParameters
 

Detailed Description

Definition at line 16 of file PndSttHelixHitProducer.h.

Constructor & Destructor Documentation

PndSttHelixHitProducer::PndSttHelixHitProducer ( )

Default constructor

Definition at line 44 of file PndSttHelixHitProducer.cxx.

References fVerbose, and PndPersistencyTask::SetPersistency().

44  :
45  PndPersistencyTask("STT HELIX Hit Producer") {
46  SetPersistency(kTRUE);
47  fVerbose = 1;
48 }
int fVerbose
Definition: poormantracks.C:24
void SetPersistency(Bool_t val=kTRUE)
PndSttHelixHitProducer::PndSttHelixHitProducer ( Int_t  verbose)

Definition at line 51 of file PndSttHelixHitProducer.cxx.

References fVerbose, PndPersistencyTask::SetPersistency(), and verbose.

51  :
52  PndPersistencyTask("STT HELIX Hit Producer") {
53  SetPersistency(kTRUE);
54  fVerbose = verbose;
55 }
int fVerbose
Definition: poormantracks.C:24
#define verbose
void SetPersistency(Bool_t val=kTRUE)
PndSttHelixHitProducer::~PndSttHelixHitProducer ( )

Destructor

Definition at line 60 of file PndSttHelixHitProducer.cxx.

60  {
61 }

Member Function Documentation

PndSttHelixHitProducer::ClassDef ( PndSttHelixHitProducer  ,
 
)
private
void PndSttHelixHitProducer::Exec ( Option_t *  opt)
virtual

Virtual method Exec

CHECK!!!

marray.AddAt(-999, k); pMhit->SetX(-999); pMhit->SetY(-999); continue; // CHECK throw away the hit

Definition at line 144 of file PndSttHelixHitProducer.cxx.

References a, PndSttTrack::AddHelixHit(), b, C(), PndSttTrack::CalculateScosl(), CAMath::Cos(), cos(), d0, Double_t, fabs(), fHelixHitArray, fHitArray, fPointArray, fTrackArray, fTrackCandArray, fTubeArray, fVerbose, PndSttHit::GetDepCharge(), PndSttTrack::GetDist(), PndSttTube::GetHalfLength(), PndTrackCandHit::GetHitId(), PndSttHit::GetIsochrone(), PndSttHit::GetIsochroneError(), PndTrackCand::GetNHits(), PndSttTrack::GetPhi(), PndSttTube::GetPosition(), PndSttTrack::GetRad(), PndTrackCand::GetSortedHit(), PndSttTrack::GetTanL(), PndSttTrack::GetTrackCandIndex(), PndSttHit::GetTubeID(), PndSttTube::GetWireDirection(), PndSttTrack::GetZ(), gGeoManager, hx, hxs, hy, hys, hz, hzresvsslope, hzs, i, m, max(), min(), phi0, point, pos, PndSttHelixHit::SetdEdx(), sin(), sqrt(), CAMath::Sqrt(), TString, vec, and z0.

144  {
145 
146  // Reset output array
147  if ( ! fHelixHitArray ) Fatal("Exec", "No HelixHitArray");
148 
149  fHelixHitArray->Clear();
150 
151  // Declare some variables
152  PndSttTrack* pTrack = NULL;
153  PndTrackCand* pTrackCand = NULL;
154 
155  if ( ! fTrackArray ) Fatal("Exec", "No fTrackArray");
156 
157 
158  // Loop over tracks
159  Int_t nTracks = fTrackArray->GetEntriesFast();
160 
161  for (Int_t j = 0; j < nTracks; j++) {
162  pTrack = (PndSttTrack *) fTrackArray->At(j);
163  if(!pTrack) continue;
164  Int_t trackCandID = pTrack->GetTrackCandIndex();
165  pTrackCand = (PndTrackCand *) fTrackCandArray->At(trackCandID);
166  if(!pTrackCand) continue;
167 
168  // if(pTrack->GetFlag() < 3) continue; // only prefit-fit-zfit CHECK
169  // --------------------------- THE TRACK ----------------------------
170  // xy
171  //Int_t hh = -(Int_t) pTrack->GetCharge(); //[R.K. 01/2017] unused variable?
172  Double_t d0 = pTrack->GetDist();
173  Double_t phi0 = pTrack->GetPhi();
174  Double_t Rad = pTrack->GetRad();
175  // z
176  Double_t z0 = pTrack->GetZ();
177  Double_t zslope = pTrack->GetTanL();
178  // center of curvature of helix
179  TVector2 vec((d0+Rad)*cos(phi0), (d0+Rad)*sin(phi0));
180  // -------------------------------------------------------------------
181 
182  Int_t hitcounter = pTrackCand->GetNHits();
183  Int_t hotcounter = 0;
184  TVector2 point; // point
185  Double_t radius = 0;
186 
187  PndSttHelixHit *helixhit = NULL;
188  for (Int_t k = 0; k < hitcounter; k++) {
189  PndTrackCandHit candhit = pTrackCand->GetSortedHit(k);
190  Int_t iHit = candhit.GetHitId();
191  PndSttHit *currenthit = (PndSttHit*) fHitArray->At(iHit);
192  if(!currenthit) { cout << "PndSttHelixHitProducer::Exec: no hit at " << iHit << endl; continue; }
193 
194  // tubeID CHECK added
195  Int_t tubeID = currenthit->GetTubeID();
196  PndSttTube *tube = (PndSttTube*) fTubeArray->At(tubeID);
197 
198  Int_t refindex = currenthit->GetRefIndex();
199  // get point
200  PndSttPoint *iPoint = (PndSttPoint*) fPointArray->At(refindex);
201  if(!iPoint) {
202  if(!iPoint) { cout << "PndSttHelixHitProducer::Exec: no point at " << refindex << " associated to hit " << iHit << endl; continue; }
203 
204  continue;
205  }
206 
207  TClonesArray& clref = *fHelixHitArray;
208  Int_t size = clref.GetEntriesFast();
209  // cout << "filling HelixHit" << endl;
210 
211  // CHECK remember to SET the errors on position!!!!!!!
212  TVector3 pos = tube->GetPosition();
213  TVector3 posErr(0, 0, 0);
214  helixhit = new(clref[size]) PndSttHelixHit(currenthit->GetDetectorID(), tubeID, iHit, refindex,
215  pos, posErr,
216  currenthit->GetIsochrone(), currenthit->GetIsochroneError(),
217  0.0);
218 
219 
220  pTrack->AddHelixHit(hitcounter, k, size);
221 
222  // helixhit->Print();
223 
224  // get point
225  // [xp, yp] point = coordinates xy of the centre of the firing tube
226  point.Set(tube->GetPosition().X(), tube->GetPosition().Y());
227  radius = currenthit->GetIsochrone();
228 
229  TVector3 wiredirection = tube->GetWireDirection();
230 
231 
232  // ================= NON SKEWED =======================
233  if(wiredirection == TVector3(0.,0.,1.))
234  {
235 
236  // x y plane / non skewed tubes -------------------------------------------------
237 
238  //==========
239  // POINT ----------------------------------------------------
240  // 1. find the cooordinates of the point fired wire of the track:
241  // the coordinates of the point are taken from the intersection
242  // between the circumference from the drift time and the Rad radius of
243  // curvature. -------------------------------------------------------
244 
245  // 2. find the intersection between the little circle and the line // Rad
246  // 2.a
247  // find the line passing throught [xc, yc] (centre of curvature) and [xp, yp] (first wire)
248  // y = mx + q
249  Double_t m = (point.Y() - vec.Y())/(point.X() - vec.X());
250  Double_t q = point.Y() - m*point.X();
251 
253  // cut on radius
254  // if the simulated radius is too small, the pMhit
255  // is not used for the fit
256  if(radius < 0.1) {
263  }
264 
265 
266  // 2.b
267  // intersection little circle and line --> [x1, y1]
268  // + and - refer to the 2 possible intersections
269  // +
270  Double_t x1 = (-(m*(q - point.Y()) - point.X()) + sqrt(fabs((m*(q - point.Y()) - point.X())*(m*(q - point.Y()) - point.X()) - (m*m + 1)*((q - point.Y())*(q - point.Y()) + point.X()*point.X() - radius*radius)))) / (m*m + 1);
271  Double_t y1 = m*x1 + q;
272  // -
273  Double_t x2 = (-(m*(q - point.Y()) - point.X()) - sqrt(fabs((m*(q - point.Y()) - point.X())*(m*(q - point.Y()) - point.X()) - (m*m + 1)*((q - point.Y())*(q - point.Y()) + point.X()*point.X() - radius*radius)))) / (m*m + 1);
274  Double_t y2 = m*x2 + q;
275 
276  // 2.c intersection between line and circle
277  // +
278  Double_t xb1 = (-(m*(q - vec.Y()) - vec.X()) + sqrt(fabs((m*(q - vec.Y()) - vec.X())*(m*(q - vec.Y()) - vec.X()) - (m*m + 1)*((q - vec.Y())*(q - vec.Y()) + vec.X()*vec.X() - (pTrack->GetRad()) *(pTrack->GetRad()))))) / (m*m + 1);
279  Double_t yb1 = m*xb1 + q;
280  // -
281  Double_t xb2 = (-(m*(q - vec.Y()) - vec.X()) - sqrt(fabs((m*(q - vec.Y()) - vec.X())*(m*(q - vec.Y()) - vec.X()) - (m*m + 1)*((q - vec.Y())*(q - vec.Y()) + vec.X()*vec.X() - (pTrack->GetRad()) *(pTrack->GetRad()))))) / (m*m + 1);
282  Double_t yb2 = m*xb2 + q;
283 
284  // calculation of the distance between [xb, yb] and [xp, yp]
285  Double_t distb1 = sqrt((yb1 - point.Y())*(yb1 - point.Y()) + (xb1 - point.X())*(xb1 - point.X()));
286  Double_t distb2 = sqrt((yb2 - point.Y())*(yb2 - point.Y()) + (xb2 - point.X())*(xb2 - point.X()));
287 
288  // choice of [xb, yb]
289  TVector2 xyb;
290  if(distb1 > distb2) xyb.Set(xb2, yb2);
291  else xyb.Set(xb1, yb1);
292 
293  // calculation of the distance between [x, y] and [xb. yb]
294  Double_t dist1 = sqrt((xyb.Y() - y1)*(xyb.Y() - y1) + (xyb.X() - x1)*(xyb.X() - x1));
295  Double_t dist2 = sqrt((xyb.Y() - y2)*(xyb.Y() - y2) + (xyb.X() - x2)*(xyb.X() - x2));
296 
297  // choice of [x, y]
298  TVector2 *xy;
299  if(dist1 > dist2) xy = new TVector2(x2, y2);
300  else xy = new TVector2(x1, y1); // <========= THIS IS THE NEW POINT to be used for the fit
301 
302  // set to helix hit x and y
303  helixhit->SetX(xy->X());
304  helixhit->SetY(xy->Y());
305  // cout << "helix final hit "<<k << " " << helixhit->GetX() << " " << helixhit->GetY() << endl;
306 
307  //=====================
308  // z plane / non skewed tubes -------------------------------------------------
309  Double_t scosl = pTrack->CalculateScosl(helixhit->GetX(), helixhit->GetY());
310  Double_t zcoord = z0 + zslope * scosl;
311  helixhit->SetZ(zcoord);
312 
313 
314  hx->Fill(iPoint->GetX() - helixhit->GetX());
315  hy->Fill(iPoint->GetY() - helixhit->GetY());
316  hz->Fill(iPoint->GetZ() - helixhit->GetZ());
317 
318 
319  // cout << "hit on helix " << helixhit->GetX() << " " << helixhit->GetY() << " " << helixhit->GetZ() << endl;
320  // cout << "mc point " << iPoint->GetX() << " "<< iPoint->GetY() << " " << iPoint->GetZ() << endl;
321 
322  // helixhit->Print();
323 
324 
325  }
326  else { // =========== SKEWED TUBE ==================
327 
328 // if(currenthit->GetZ() != -999)
329 // {
330 // // get the track fit result
331 // helixhit->SetX(currenthit->GetX());
332 // helixhit->SetY(currenthit->GetY());
333 // helixhit->SetZ(currenthit->GetZ());
334 // }
335 // else
336  {
337  // CHECK the reason why these are different from the previous ones!
338 
339  TVector3 *tofit, *tofit2;
340 
341  wiredirection *= tube->GetHalfLength();
342  TVector3 cenposition = tube->GetPosition();
343 
344  TVector3 min, max;
345  min = cenposition - wiredirection;
346  max = cenposition + wiredirection;
347 
348  // first extremity
349  Double_t x_1= min.X();
350  Double_t y_1= min.Y();
351  Double_t z_1= min.Z();
352 
353  // second extremity
354  Double_t x_2= max.X();
355  Double_t y_2= max.Y();
356  Double_t z_2= max.Z();
357 
358  Double_t x1 = -9999.;
359  Double_t y1 = -9999.;
360  Double_t x2 = -9999.;
361  Double_t y2 = -9999.;
362 
363  // from xy plane fit
364  //Double_t x0 = d0*TMath::Cos(phi0); //[R.K. 01/2017] unused variable?
365  //Double_t y0 = d0*TMath::Sin(phi0); //[R.K. 01/2017] unused variable?
366  // in xy plane: angle of the PCA to the origin
367  // with respect to the curvature center
368  //Double_t Phi0 = TMath::ATan2((y0 - vec.Y()),(x0 - vec.X())); //[R.K. 01/2017] unused variable?
369 
370  Double_t a = -999;
371  Double_t b = -999;
372 
373  // intersection point between the reconstructed
374  // circumference and the line joining the centres
375  // of the reconstructed circle and the i_th drift circle
376  if(fabs(x_2-x_1)>0.0001) {
377  a =(y_2-y_1)/(x_2-x_1);
378  b =(y_1-a*x_1);
379  Double_t A = a*a+1;
380  Double_t B = vec.X()+a*vec.Y()-a*b;
381  Double_t C = vec.X()*vec.X()+vec.Y()*vec.Y()+b*b-Rad*Rad-2*vec.Y()*b;
382  if((B*B-A*C)>0) {
383  x1= (B+TMath::Sqrt(B*B-A*C))/A;
384  x2= (B-TMath::Sqrt(B*B-A*C))/A;
385  y1=a*x1+b;
386  y2=a*x2+b;
387  }
388  }
389  else if(fabs(y_2-y_1)>0.0001) {
390  Double_t A = 1;
391  Double_t B = vec.Y();
392  Double_t C = vec.Y()*vec.Y() +(x_1-vec.X())*(x_1-vec.X()) -Rad*Rad;
393 
394  if((B*B-A*C)>0) {
395  y1= (B+TMath::Sqrt(B*B-A*C))/A;
396  y2= (B-TMath::Sqrt(B*B-A*C))/A;
397  x1=x2=x_1;
398  }
399  }
400  else {
401  if(fVerbose == 2) cout << "-E- intersection point not found" << endl;
402  continue;
403  }
404 
405  //x1 and x2 are the 2 intersection points
406  Double_t d1=TMath::Sqrt((x1-cenposition.X())*(x1-cenposition.X())+
407  (y1-cenposition.Y())*(y1-cenposition.Y()));
408  Double_t d2=TMath::Sqrt((x2-cenposition.X())*(x2-cenposition.X())+
409  (y2-cenposition.Y())*(y2-cenposition.Y()));
410 
411  Double_t x_ = x1;
412  Double_t y_ = y1;
413 
414  // the intersection point nearest to the drift circle's centre is taken
415  if(d2<d1) {x_=x2;y_=y2;}
416 
417 
418  // now we need to find the actual centre of the drift circle,
419  // by translating the drift circle until it becomes tangent
420  // to the reconstructed circle.
421  // Two solutions are possible (left rigth abiguity),
422  // they are both kept, only the following zed fit will discard the wrong ones.
423  // Using the parametric equation of the 3d-straigth line and taking the
424  // x points just obtained, the zed coordinate of the skewed tube centre is calculated.
425 
426  if(x_1 == x_2)
427  {
428  x1 = x_;
429  y1 = y_ + radius;
430  x2 = x_;
431  y2 = y_ - radius;
432  }
433  else {
434  //solving the equation to find out the centre of the tangent circle
435  Double_t A = a*a+1;
436  Double_t B = -(a*b-a*y_-x_);
437  Double_t C = x_*x_+ y_*y_+b*b-2*b*y_-radius*radius;
438  if((B*B-A*C)>0) {
439  x1= (B+TMath::Sqrt(B*B-A*C))/A;
440  x2= (B-TMath::Sqrt(B*B-A*C))/A;
441  y1=a*x1+b;
442  y2=a*x2+b;
443  }
444  else if((B*B-A*C)==0){
445  x1= B/A;
446  x2 = x1;
447  y1=a*x1+b;
448  y2=a*x2+b;
449  }
450  else {
451  if(fVerbose == 2) cout << "NO WAY2" << endl;
452  continue;
453  }
454  }
455 
456  d1=TMath::Sqrt((x1-cenposition.X())*(x1-cenposition.X())+(y1-cenposition.Y())*(y1-cenposition.Y()));
457  d2=TMath::Sqrt((x2-cenposition.X())*(x2-cenposition.X())+(y2-cenposition.Y())*(y2-cenposition.Y()));
458 
459  Double_t xcen0=x1;
460  Double_t xcen1=x2;
461  Double_t ycen0=y1;
462  Double_t ycen1=y2;
463 
464  if(d2<d1) { // z2 contains the points nearest (in x-y) to the initial centre of the skewed tube
465  xcen0=x2;
466  xcen1=x1;
467  ycen0=y2;
468  ycen1=y1;
469 
470  }
471 
472  // zed association
473  Double_t t_, z_, t_bis, z_bis;
474  if(fabs(x_2-x_1)<0.001) {
475  t_ =(ycen0-y_1)/(y_2-y_1); // k= a_y*t + y_1 [t=1 y=y_2]
476  z_ =(z_2-z_1)*t_ +z_1; // z= a_z*t + z_1 [t=1 z=z_2]
477  t_bis =(ycen1-y_1)/(y_2-y_1); // from y_'s (the 2 solutions of the 2nd order equation)
478  z_bis =(z_2-z_1)*t_bis +z_1; // and the 2 parametric equations the z coord. are obtained
479  }
480  else{
481  t_ =(xcen0-x_1)/(x_2-x_1); // x= a_x*t + x_1 [t=1 x=x_2]
482  z_ =(z_2-z_1)*t_ +z_1; // z= a_z*t + z_1 [t=1 z=z_2]
483  t_bis =(xcen1-x_1)/(x_2-x_1); // from x_'s (the 2 solutions of the 2nd order equation)
484  z_bis =(z_2-z_1)*t_bis +z_1; // and the 2 parametric equations the z coord. are obtained
485  }
486 
487  // tofit = new TVector3(xcen0,ycen0,z_);
488  tofit = new TVector3(x_,y_,z_);
489  // tofit2 = new TVector3(xcen1,ycen1,z_bis);
490  tofit2 = new TVector3(x_,y_,z_bis);
491 
492  // I have 2 choices, I prefer the nearest to the line CHECK (DEVE ESSERE MESSO TUTTO A POSTO L' ASSOCIAZIONE DELLA Z!)
493  // calculate scosl
494  Double_t scosl_ = pTrack->CalculateScosl(x_, y_);
495  Double_t zcoord_ = z0 + zslope * scosl_;
496  TVector3 *tofit3 = new TVector3(x_, y_, zcoord_);
497 
498  double distance_1 = sqrt((tofit->X() - tofit3->X())*(tofit->X() - tofit3->X())
499  + (tofit->Y() - tofit3->Y())*(tofit->Y() - tofit3->Y())
500  + (tofit->Z() - tofit3->Z())*(tofit->Z() - tofit3->Z()));
501 
502  double distance_2 = sqrt((tofit2->X() - tofit3->X())*(tofit2->X() - tofit3->X())
503  + (tofit2->Y() - tofit3->Y())*(tofit2->Y() - tofit3->Y())
504  + (tofit2->Z() - tofit3->Z())*(tofit2->Z() - tofit3->Z()));
505 
506  if(distance_1 < distance_2) helixhit->SetPosition(*tofit);
507  else helixhit->SetPosition(*tofit2);
508  }
509 
510  //=====================
511  // z plane / non skewed tubes -------------------------------------------------
512  //Double_t scosl = pTrack->CalculateScosl(helixhit->GetX(), helixhit->GetY()); //[R.K. 01/2017] unused variable?
513  //Double_t zcoord = z0 + zslope * scosl; //[R.K. 01/2017] unused variable?
514  // helixhit->SetZ(zcoord);
515 
516  // cout << "helix hit skewed " << helixhit->GetX() << " " << helixhit->GetY() << " " << helixhit->GetZ() << endl; // CHECK the procedure!!
517  // cout << "mc point " << iPoint->GetX() << " "<< iPoint->GetY() << " " << iPoint->GetZ() << endl;
518 
519  hxs->Fill(iPoint->GetX() - helixhit->GetX());
520  hys->Fill(iPoint->GetY() - helixhit->GetY());
521  hzs->Fill(iPoint->GetZ() - helixhit->GetZ());
522  hzresvsslope->Fill(zslope, (iPoint->GetZ() - helixhit->GetZ()));
523  }
524 
525 
526  // dE/dx calculation ==================
527 
528  TString tubename;
529  TGeoVolume *gastube; // CHECK we may use tube (fTubeArray) instead of repeating the procedure...
530  TObjArray *volumeArray = gGeoManager->GetListOfVolumes();
531 
532  for(int i = 0; i < volumeArray->GetEntriesFast() ; i++)
533  {
534  tubename = volumeArray->At(i)->GetName();
535  if(tubename.Contains("stt") && tubename.Contains("gas"))
536  {
537  gastube = (TGeoVolume*) volumeArray->At(i);
538  break;
539  }
540  }
541  TGeoTube *geotube = (TGeoTube*) gastube->GetShape();
542  Double_t tuberadius = geotube->GetRmax();
543  Double_t distance = 2 * sqrt(tuberadius * tuberadius - radius * radius); // cm
544  Double_t coslam = TMath::Cos(TMath::ATan(zslope));
545  distance = distance / coslam;
546 
547  Double_t dedx = 0.;
548  if (distance != 0) dedx = currenthit->GetDepCharge()/(1000000 * distance); // in arbitrary units
549 
550  helixhit->SetdEdx(dedx);
551 
552 
553  hotcounter++;
554  }
555 
556  // Track summary
557  if(fVerbose == 2) {
558  cout << "-I- PndSttHelixHitProducer: " << j << " track " << hitcounter << " SttHits, "
559  << hotcounter << " HelixHits created." << endl;
560  cout << "----------------------------------------" << endl;
561  }
562  }
563 
564 
565 }
TVector3 pos
Double_t z0
Definition: checkhelixhit.C:62
int fVerbose
Definition: poormantracks.C:24
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
Double_t GetTanL()
Definition: PndSttTrack.h:60
Double_t GetZ()
Definition: PndSttTrack.h:61
Int_t i
Definition: run_full.C:25
__m128 m
Definition: P4_F32vec4.h:28
TTree * b
Double_t GetHalfLength()
Definition: PndSttTube.cxx:99
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
Int_t GetTrackCandIndex()
Definition: PndSttTrack.h:45
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
PndTrackCandHit GetSortedHit(UInt_t i)
Definition: PndTrackCand.h:54
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:26
TGeoManager * gGeoManager
static T Cos(const T &x)
Definition: PndCAMath.h:43
void AddHelixHit(Int_t size, Int_t index, Int_t helixhitindex)
Definition: PndSttTrack.cxx:42
Double_t GetDist()
Definition: PndSttTrack.h:57
Double_t d0
Definition: checkhelixhit.C:59
int Pic_FED Eff_lEE C()
Double_t GetRad()
Definition: PndSttTrack.h:59
Int_t a
Definition: anaLmdDigi.C:126
Double_t GetPhi()
Definition: PndSttTrack.h:58
Double_t GetIsochrone() const
Definition: PndSttHit.h:62
Double_t
Double_t phi0
Definition: checkhelixhit.C:60
TVector3 GetPosition()
Definition: PndSttTube.cxx:87
Int_t GetTubeID() const
Definition: PndSttHit.h:75
Double_t GetIsochroneError() const
Definition: PndSttHit.h:63
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:25
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
Double_t GetDepCharge() const
Definition: PndSttHit.h:65
Double_t CalculateScosl(Double_t x, Double_t y)
UInt_t GetNHits() const
Definition: PndTrackCand.h:59
Int_t GetHitId() const
void SetdEdx(Double_t dedx)
dble_vec_t vec[12]
Definition: ranlxd.cxx:380
TVector3 GetWireDirection()
Definition: PndSttTube.cxx:107
PndSdsMCPoint * point
Definition: anaLmdCluster.C:72
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(), 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(), PndEmcHitProducer::Init(), PndRecoMultiKalmanTask2::Init(), PndDrcHitProducerReal::Init(), PndDskFLGHitProducerIdeal::Init(), PndEmcTmpWaveformToDigi::Init(), PndDrcDigiTask::Init(), PndEmcWaveformToDigi::Init(), PndSttMatchTracks::Init(), PndEmcWaveformToCalibratedDigi::Init(), PndTrkTracking2::Init(), PndSttFindTracks::Init(), PndEmcMultiWaveformToCalibratedDigi::Init(), PndDrcTimeDigiTask::Init(), PndRecoKalmanTask2::Init(), PndEmcExpClusterSplitter::Init(), PndSdsNoiseProducer::Init(), PndFtsHoughTrackerTask::Init(), PndEmcPhiBumpSplitter::Init(), PndSdsHybridHitProducer::Init(), PndSdsIdealRecoTask::Init(), PndRecoMultiKalmanTask::Init(), PndSdsIdealClusterTask::Init(), PndRecoKalmanTask::Init(), PndSdsStripHitProducerDif::Init(), PndSdsStripHitProducer::Init(), PndGemDigitize::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 PndSttHelixHitProducer::Init ( )
virtual

Virtual method Init

Definition at line 67 of file PndSttHelixHitProducer.cxx.

References fHelixHitArray, fHitArray, PndSttMapCreator::FillTubeArray(), fPointArray, fSttParameters, fTrackArray, fTrackCandArray, fTubeArray, PndPersistencyTask::GetPersistency(), hx, hxs, hy, hys, hz, hzresvsslope, and hzs.

67  {
68 
69  hx = new TH1F("hx", "x: mc - reco", 100, -1, 1);
70  hy = new TH1F("hy", "y: mc - reco", 100, -1, 1);
71  hz = new TH1F("hz", "z: mc - reco", 100, -3, 3);
72 
73  hxs = new TH1F("hxs", "x: mc - reco", 100, -1, 1);
74  hys = new TH1F("hys", "y: mc - reco", 100, -1, 1);
75  hzs = new TH1F("hzs", "z: mc - reco", 100, -3, 3);
76 
77  hzresvsslope = new TH2F("hzresvsslope", "z: mc - reco vs slope", 100, -3.5, 3.5, 100, -3., 3.);
78 
79  // Get RootManager
80  FairRootManager* ioman = FairRootManager::Instance();
81  if ( ! ioman ) {
82  cout << "-E- PndSttHelixHitProducer::Init: "
83  << "RootManager not instantiated!" << endl;
84  return kFATAL;
85  }
86 
87  // Get SttTrack array
88  fTrackArray = (TClonesArray*) ioman->GetObject("STTTrack");
89  if ( ! fTrackArray)
90  {
91  cout << "-E- CbmSttFitTracks::Init: No SttTrack array!"
92  << endl;
93  return kERROR;
94  }
95 
96  // Get SttTrackCand array
97  fTrackCandArray = (TClonesArray*) ioman->GetObject("STTTrackCand");
98  if ( ! fTrackCandArray)
99  {
100  cout << "-E- CbmSttFitTracks::Init: No SttTrack Cand array!"
101  << endl;
102  return kERROR;
103  }
104 
105  // Get input array
106  fPointArray = (TClonesArray*) ioman->GetObject("STTPoint");
107  if ( ! fPointArray ) {
108  cout << "-W- PndSttHelixHitProducer::Init: "
109  << "No STTPoint array!" << endl;
110  return kERROR;
111  }
112 
113  // Get input array
114  fHitArray = (TClonesArray*) ioman->GetObject("STTHit");
115  if ( ! fHitArray ) {
116  cout << "-W- PndSttHelixHitProducer::Init: "
117  << "No STTHit array!" << endl;
118  return kERROR;
119  }
120 
121  // Create and register output array
122  fHelixHitArray = new TClonesArray("PndSttHelixHit");
123  ioman->Register("SttHelixHit","STT",fHelixHitArray, GetPersistency());
124 
125  // CHECK added
127  fTubeArray = mapper->FillTubeArray();
128 
129  cout << "-I- PndSttHelixHitProducer: Intialization successfull" << endl;
130 
131  return kSUCCESS;
132 
133 }
TClonesArray * FillTubeArray()
void PndSttHelixHitProducer::SetParContainers ( )

Definition at line 137 of file PndSttHelixHitProducer.cxx.

References fSttParameters, and rtdb.

137  {
138  FairRuntimeDb* rtdb = FairRunAna::Instance()->GetRuntimeDb();
139  fSttParameters = (PndGeoSttPar*) rtdb->getContainer("PndGeoSttPar");
140 }
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
void PndSttHelixHitProducer::SetPersistence ( Bool_t  persistence)
inline

set persistence flag

Definition at line 41 of file PndSttHelixHitProducer.h.

References PndPersistencyTask::SetPersistency().

41 { SetPersistency(persistence); }
void SetPersistency(Bool_t val=kTRUE)
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::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(), 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(), 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 PndSttHelixHitProducer::WriteHistograms ( )

Definition at line 567 of file PndSttHelixHitProducer.cxx.

References file, hx, hxs, hy, hys, hz, hzresvsslope, and hzs.

567  {
568  TFile* file = FairRootManager::Instance()->GetOutFile();
569  file->cd();
570  file->mkdir("PndSttHelixHit");
571  file->cd("PndSttHelixHit");
572 
573  hx->Write();
574  delete hx;
575  hy->Write();
576  delete hy;
577  hz->Write();
578  delete hz;
579 
580  hxs->Write();
581  delete hxs;
582  hys->Write();
583  delete hys;
584  hzs->Write();
585  delete hzs;
586 
587  hzresvsslope->Write();
588  delete hzresvsslope;
589 }
TFile * file

Member Data Documentation

TClonesArray* PndSttHelixHitProducer::fHelixHitArray
private

Output array of PndSttHelixHits

Definition at line 58 of file PndSttHelixHitProducer.h.

Referenced by Exec(), and Init().

TClonesArray* PndSttHelixHitProducer::fHitArray
private

Input array of PndSttHits

Definition at line 51 of file PndSttHelixHitProducer.h.

Referenced by Exec(), and Init().

TClonesArray* PndSttHelixHitProducer::fPointArray
private

Input array of PndSttPoints

Definition at line 49 of file PndSttHelixHitProducer.h.

Referenced by Exec(), and Init().

PndGeoSttPar* PndSttHelixHitProducer::fSttParameters
private

Definition at line 69 of file PndSttHelixHitProducer.h.

Referenced by Init(), and SetParContainers().

TClonesArray* PndSttHelixHitProducer::fTrackArray
private

Input array of PndSttTracks

Definition at line 53 of file PndSttHelixHitProducer.h.

Referenced by Exec(), and Init().

TClonesArray* PndSttHelixHitProducer::fTrackCandArray
private

Input array of PndTracksCand

Definition at line 55 of file PndSttHelixHitProducer.h.

Referenced by Exec(), and Init().

TClonesArray* PndSttHelixHitProducer::fTubeArray
private

from parameters array of PndSttTube

Definition at line 61 of file PndSttHelixHitProducer.h.

Referenced by Exec(), and Init().

TH1F* PndSttHelixHitProducer::hx
private

Definition at line 64 of file PndSttHelixHitProducer.h.

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

TH1F* PndSttHelixHitProducer::hxs
private

Definition at line 65 of file PndSttHelixHitProducer.h.

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

TH1F * PndSttHelixHitProducer::hy
private

Definition at line 64 of file PndSttHelixHitProducer.h.

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

TH1F * PndSttHelixHitProducer::hys
private

Definition at line 65 of file PndSttHelixHitProducer.h.

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

TH1F * PndSttHelixHitProducer::hz
private

Definition at line 64 of file PndSttHelixHitProducer.h.

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

TH2F* PndSttHelixHitProducer::hzresvsslope
private

Definition at line 66 of file PndSttHelixHitProducer.h.

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

TH1F * PndSttHelixHitProducer::hzs
private

Definition at line 65 of file PndSttHelixHitProducer.h.

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


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