/[PAMELA software]/PamCut/CaloCuts/CaloGeomCut/CaloGeomCut.cpp
ViewVC logotype

Diff of /PamCut/CaloCuts/CaloGeomCut/CaloGeomCut.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by pam-fi, Wed May 27 13:30:09 2009 UTC revision 1.2 by pam-fi, Wed Mar 10 08:42:31 2010 UTC
# Line 11  Line 11 
11    
12  int CaloGeomCut::Check(PamLevel2 *event) {  int CaloGeomCut::Check(PamLevel2 *event) {
13    
14    float xCaloTrack;    Float_t xCaloTrack;
15    float yCaloTrack;    Float_t yCaloTrack;
16      
17      Double_t tanx, tany, beta;
18      Float_t alCaloTop[5]; // MUST be Float_t
19      Int_t nPoint = TrkParams::nGF+1; // MUST be Int_t
20      Float_t zIn[nPoint]; // MUST be Float_t
21      
22      Trajectory* traj = NULL;
23      
24      static const Float_t zCaloTop=-26.181; // cm MUST Float_t
25    
26      tanx=_xCaloAxis->par[1];
27      tany=_yCaloAxis->par[1];
28            
29      if (_iMethod==0) {
30      }
31      else if (_iMethod==1) { // curved track in the Pamela acceptance (back-propagated starting from the straight track in the calorimeter, evaluated at the top of calorimeter, which is of course better than at higher z coordinates)
32        for (Int_t igf = 0; igf < TrkParams::nGF; igf++) {
33          zIn[igf]=TrkParams::zGF[igf];
34        }
35        zIn[TrkParams::nGF]=zCaloTop;
36        
37        traj = (Trajectory*) new Trajectory(nPoint,zIn);
38        
39        alCaloTop[0]=_xCaloAxis->GetYfit(zCaloTop); // Yfit   [xCaloTop]
40        alCaloTop[1]=_yCaloAxis->GetYfit(zCaloTop); // Yfit  [yCaloTop]
41        alCaloTop[2]=sin(atan(sqrt(pow(tanx,2)+pow(tany,2)))); // [sintheta]
42        alCaloTop[3]=TMath::Pi()+atan2(tany,tanx); // [phi]
43    
44        beta = event->GetToFLevel2()->CalcBeta(0,_resMax,_qualCut,_chi2Cut); // TOF stand-alone beta
45        alCaloTop[4] = 1./(_mass*beta/sqrt(1.-pow(beta,2))); // [etaP] [rho = (m/Z)*(beta/(sqrt(1-beta^2)))]
46    
47        traj->DoTrack(alCaloTop,zCaloTop);
48          
49      }
50      else {
51        return 1;
52      }
53    
54    for (Int_t igf = 0; igf < TrkParams::nGF; igf++) {    for (Int_t igf = 0; igf < TrkParams::nGF; igf++) {
55      xCaloTrack = _xCaloAxis->par[0] + (_xCaloAxis->par[1]) * TrkParams::zGF[igf]; // cm        
56        if (_iMethod==0) { // straight track
57          // NOTE: par[0] is the x (y) coordinate on plane z=0 in PAMELA reference (magnet centre)
58          xCaloTrack = _xCaloAxis->par[0] + tanx * TrkParams::zGF[igf]; // cm
59          yCaloTrack = _yCaloAxis->par[0] + tany * TrkParams::zGF[igf]; // cm
60        }
61        else if (_iMethod==1) {
62          xCaloTrack = traj->x[igf];
63          yCaloTrack = traj->y[igf];
64        }
65        
66      if (! (TrkParams::xGF_min[igf] + _xTolCaloTrack < xCaloTrack && xCaloTrack < TrkParams::xGF_max[igf]      if (! (TrkParams::xGF_min[igf] + _xTolCaloTrack < xCaloTrack && xCaloTrack < TrkParams::xGF_max[igf]
67          - _xTolCaloTrack) ) {          - _xTolCaloTrack) ) {
68        return 0;        return 0;
69      }      }
70    
     yCaloTrack = _yCaloAxis->par[0] + (_yCaloAxis->par[1]) * TrkParams::zGF[igf]; // cm  
71      if (! (TrkParams::yGF_min[igf] + _yTolCaloTrack < yCaloTrack && yCaloTrack < TrkParams::yGF_max[igf]      if (! (TrkParams::yGF_min[igf] + _yTolCaloTrack < yCaloTrack && yCaloTrack < TrkParams::yGF_max[igf]
72          - _yTolCaloTrack) ) {          - _yTolCaloTrack) ) {
73        return 0;        return 0;
74      }      }
75        
76    }    }
77    
78    return CUTOK;    return CUTOK;
79      
80  }  }

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.23