/[PAMELA software]/DarthVader/TrackerLevel2/src/ExtTrkingAlg.cpp
ViewVC logotype

Diff of /DarthVader/TrackerLevel2/src/ExtTrkingAlg.cpp

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

revision 1.2 by pam-ts, Wed Jun 4 07:57:03 2014 UTC revision 1.3 by mocchiut, Fri Jun 6 11:24:01 2014 UTC
# Line 28  ExtTrkingAlg::ExtTrkingAlg(Int_t id){ Line 28  ExtTrkingAlg::ExtTrkingAlg(Int_t id){
28    
29        
30    if(id == 0){    if(id == 0){
31        if(_debug){
32      cout << "ExtTrkingAlg::ExtTrkingAlg("<<id<<")"<<endl;        cout << "ExtTrkingAlg::ExtTrkingAlg("<<id<<")"<<endl;
33      cout << "Creating array of TrkTrack objects "<<endl;        cout << "Creating array of TrkTrack objects "<<endl;
34      cout << "WARNING!!! tracking not accurate!! bug not fixed yet... "<<endl;        cout << "WARNING!!! tracking not accurate!! bug not fixed yet... "<<endl;
35            }
36      _trkArray = new TClonesArray("TrkTrack");      _trkArray = new TClonesArray("TrkTrack");
37      //      //
38      _sel_nClstrMAX  = 20. ; // selection parameter: maximum number of cluster      _sel_nClstrMAX  = 20. ; // selection parameter: maximum number of cluster
# Line 55  ExtTrkingAlg::ExtTrkingAlg(Int_t id){ Line 55  ExtTrkingAlg::ExtTrkingAlg(Int_t id){
55    }else if ( (id >= 100 && id < 144) ||    }else if ( (id >= 100 && id < 144) ||
56               (id >= 200 && id < 244) ||               (id >= 200 && id < 244) ||
57               false){ //add n calo planes               false){ //add n calo planes
58        if(_debug){
59      cout << "ExtTrkingAlg::ExtTrkingAlg("<<id<<")"<<endl;        cout << "ExtTrkingAlg::ExtTrkingAlg("<<id<<")"<<endl;
60      cout << "Creating array of ExtTrack objects "<<endl;        cout << "Creating array of ExtTrack objects "<<endl;
61        }
62      _trkArray = new TClonesArray("ExtTrack");      _trkArray = new TClonesArray("ExtTrack");
63      //      //
64      _alg_nClFixX   = 3.;     // algorythm parameter: n.hits required on X view      _alg_nClFixX   = 3.;     // algorythm parameter: n.hits required on X view
# Line 106  ExtTrkingAlg::ExtTrkingAlg(Int_t id){ Line 107  ExtTrkingAlg::ExtTrkingAlg(Int_t id){
107      //------------------------------------------      //------------------------------------------
108      // read alignment parameters      // read alignment parameters
109      //------------------------------------------      //------------------------------------------
110      cout << "Reading calorimeter alignment parameters"<<endl;      if(_debug) cout << "Reading calorimeter alignment parameters"<<endl;
111      const char *pamca = gSystem->Getenv("PAM_CALIB");      const char *pamca = gSystem->Getenv("PAM_CALIB");
112      TString filep = "/trk-param/align_param_calo-0/CaloAlignParams.txt";      TString filep = "/trk-param/align_param_calo-0/CaloAlignParams.txt";
113      filep.Prepend(pamca);      filep.Prepend(pamca);
# Line 123  ExtTrkingAlg::ExtTrkingAlg(Int_t id){ Line 124  ExtTrkingAlg::ExtTrkingAlg(Int_t id){
124    
125    
126              int index = (plane*2+1-view)*9 + sensor;              int index = (plane*2+1-view)*9 + sensor;
127              cout<<index<<" >> ";              if(_debug){
128              cout<<view << " "<<plane<<" "<<sensor<<"          ";                cout<<index<<" >> ";
129              for(int i=0; i<5; i++)cout<<setw(10)<<par[i]<<" "<<setw(10)<<err[i]<<" ";                cout<<view << " "<<plane<<" "<<sensor<<"          ";
130              cout<<endl;                for(int i=0; i<5; i++)cout<<setw(10)<<par[i]<<" "<<setw(10)<<err[i]<<" ";
131                  cout<<endl;
132                }
133    
134              _caloStripRoto[index].SetAligParams__fPitch(par[0]);              _caloStripRoto[index].SetAligParams__fPitch(par[0]);
135              _caloStripRoto[index].SetAligParams__shift(par+1);              _caloStripRoto[index].SetAligParams__shift(par+1);
# Line 156  ExtTrkingAlg::ExtTrkingAlg(Int_t id){ Line 159  ExtTrkingAlg::ExtTrkingAlg(Int_t id){
159    
160      for(int ip =0 ; ip<_extTrack->nplanes; ip++ )_extTrack->SetZ(ip,_zMech[ip]);      for(int ip =0 ; ip<_extTrack->nplanes; ip++ )_extTrack->SetZ(ip,_zMech[ip]);
161    
162      cout <<" Extended-track Z-coordinates: "<<endl;      if ( _debug ){
163      for(int ip =0 ; ip<_extTrack->nplanes; ip++ )cout <<  _extTrack->zm[ip]<<endl;        cout <<" Extended-track Z-coordinates: "<<endl;
164              for(int ip =0 ; ip<_extTrack->nplanes; ip++ )cout <<  _extTrack->zm[ip]<<endl;
165        }
166    }else{    }else{
167            if ( _debug ){
168      cout << "ExtTrkingAlg(Int_t id) -- algorythm id="<<id<<" not valid "<<endl;        cout << "ExtTrkingAlg(Int_t id) -- algorythm id="<<id<<" not valid "<<endl;
169      cout << "--> Track array not created "<<endl;        cout << "--> Track array not created "<<endl;
170        }
171      _sel_nClstrMAX  = 0.;      _sel_nClstrMAX  = 0.;
172      _sel_nPlaneXMIN = 0.;        _sel_nPlaneXMIN = 0.;  
173      _sel_nPlaneYMIN = 0.;        _sel_nPlaneYMIN = 0.;  
# Line 479  void ExtTrkingAlg::ProcessEvent0(Bool_t Line 484  void ExtTrkingAlg::ProcessEvent0(Bool_t
484    }//end iterations    }//end iterations
485        
486    
487    if( trackCandidates[mapIndex].size() > nTrackMAX ){    if( trackCandidates[mapIndex].size() > (uint)nTrackMAX ){ // EM,  warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
488      if(_debug)cout << "n.candidates "<<trackCandidates[mapIndex].size()<<" > "<<nTrackMAX<<endl;      if(_debug)cout << "n.candidates "<<trackCandidates[mapIndex].size()<<" > "<<nTrackMAX<<endl;
489      return;//to many candidates      return;//to many candidates
490    }    }
# Line 491  void ExtTrkingAlg::ProcessEvent0(Bool_t Line 496  void ExtTrkingAlg::ProcessEvent0(Bool_t
496        cout << " >> ";        cout << " >> ";
497        cout << " X: ";        cout << " X: ";
498        for(int ip=0; ip<6; ip++)        for(int ip=0; ip<6; ip++)
499          if(trackCand.GetClusterX_ID(ip)>=0)cout << trackCand.GetClusterX_ID(ip)<<":"<<trackCand.GetSensor(ip)<<"|";          if(trackCand.GetClusterX_ID(ip)>=0)cout << trackCand.GetClusterX_ID(ip)<<":"<<trackCand.GetSensor(ip)<<"|";
500        cout << " Y: ";        cout << " Y: ";
501        for(int ip=0; ip<6; ip++)        for(int ip=0; ip<6; ip++)
502          if(trackCand.GetClusterY_ID(ip)>=0)cout << trackCand.GetClusterY_ID(ip)<<":"<<trackCand.GetSensor(ip)<<"|";              if(trackCand.GetClusterY_ID(ip)>=0)cout << trackCand.GetClusterY_ID(ip)<<":"<<trackCand.GetSensor(ip)<<"|";    
503        cout << endl;        cout << endl;
504      }      }
505    }    }
# Line 1293  bool ExtTrkingAlg::EvaluateClusterPositi Line 1298  bool ExtTrkingAlg::EvaluateClusterPositi
1298    //  int plane = 6 + cluster.view;            //0...21    //  int plane = 6 + cluster.view;            //0...21
1299    int plane = (int)(cluster.view / 2 );    //0...21    int plane = (int)(cluster.view / 2 );    //0...21
1300    int ladder = (int)(cluster.coordPU / 32);//0...2    int ladder = (int)(cluster.coordPU / 32);//0...2
1301    int view = cluster.view;//0...43    //  int view = cluster.view;//0...43    // EM, unused variable
1302    bool isX = (cluster.view)%2;    bool isX = (cluster.view)%2;
1303    bool isY = !isX;    bool isY = !isX;
1304        
# Line 1442  bool ExtTrkingAlg::EvaluateClusterPositi Line 1447  bool ExtTrkingAlg::EvaluateClusterPositi
1447            
1448            int view = cluster.view; //0... 43            int view = cluster.view; //0... 43
1449    
1450            int nW = (int)((view + 1)/2);            //      int nW = (int)((view + 1)/2); // EM, unused variable
1451            float dW = 0.74*factor;//X0            float dW = 0.74*factor;//X0
1452            float dW_cm = 0.26*factor;//cm            float dW_cm = 0.26*factor;//cm
1453            float dSi_cm = 0.; //cm            float dSi_cm = 0.; //cm
# Line 1472  bool ExtTrkingAlg::EvaluateClusterPositi Line 1477  bool ExtTrkingAlg::EvaluateClusterPositi
1477    
1478    }    }
1479    
1480      return true; // EM, warning: no return statement in function returning non-void [-Wreturn-type]
1481  }  }
1482    
1483    
# Line 1762  void ExtTrkingAlg::ProcessEvent1(Bool_t Line 1767  void ExtTrkingAlg::ProcessEvent1(Bool_t
1767    
1768            }            }
1769    
1770            if( trackCandidates[mapIndex].size() > nTrackMAX ){            if( trackCandidates[mapIndex].size() > (uint)nTrackMAX ){ // EM, compilation warning comparison between signed and unsigned
1771              if(_debug)cout << "n.candidates "<<trackCandidates[mapIndex].size()<<" > "<<nTrackMAX<<endl;              if(_debug)cout << "n.candidates "<<trackCandidates[mapIndex].size()<<" > "<<nTrackMAX<<endl;
1772              return;//to many candidates              return;//to many candidates
1773            }            }
# Line 2242  void ExtTrkingAlg::ProcessEvent1(Bool_t Line 2247  void ExtTrkingAlg::ProcessEvent1(Bool_t
2247        // and        // and
2248        // evaluated other track info        // evaluated other track info
2249        // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~          // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
2250        float VMS[22];VMS[0]=0.;        //      float VMS[22];VMS[0]=0.; // EM, 2245:13: warning: variable ?VMS? set but not used [-Wunused-but-set-variable]
2251        for(int ip=0; ip<NEXTPLANES; ip++){        for(int ip=0; ip<NEXTPLANES; ip++){
2252    
2253          if(!t_track.XGood(ip)&&!t_track.YGood(ip))continue;          if(!t_track.XGood(ip)&&!t_track.YGood(ip))continue;
# Line 2823  void ExtTrkingAlg::ProcessEvent2(Bool_t Line 2828  void ExtTrkingAlg::ProcessEvent2(Bool_t
2828    
2829                        }                        }
2830    
2831                        if( trackCandidates[mapIndex+1].size() > nTrackMAX ){                        if( trackCandidates[mapIndex+1].size() > (uint)nTrackMAX ){ //EM, 2826:50: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
2832                            if(_debug)cout << "n.candidates "<<trackCandidates[mapIndex+1].size()<<" > "<<nTrackMAX<<endl;                            if(_debug)cout << "n.candidates "<<trackCandidates[mapIndex+1].size()<<" > "<<nTrackMAX<<endl;
2833                            return;//to many candidates                            return;//to many candidates
2834                        }                        }
# Line 3292  void ExtTrkingAlg::ProcessEvent2(Bool_t Line 3297  void ExtTrkingAlg::ProcessEvent2(Bool_t
3297                // and                // and
3298                // evaluated other track info                // evaluated other track info
3299                // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
3300                float VMS[22];VMS[0]=0.;                //float VMS[22];VMS[0]=0.;  //EM, 3295:14: warning: variable ?VMS? set but not used [-Wunused-but-set-variable]
3301                for(int ip=0; ip<NEXTPLANES; ip++){                for(int ip=0; ip<NEXTPLANES; ip++){
3302    
3303                    if(!t_track.XGood(ip)&&!t_track.YGood(ip))continue;                    if(!t_track.XGood(ip)&&!t_track.YGood(ip))continue;

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

  ViewVC Help
Powered by ViewVC 1.1.23