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

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

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

revision 1.15 by pam-fi, Thu Mar 15 12:17:10 2007 UTC revision 1.20 by pam-fi, Mon Aug 20 15:47:57 2007 UTC
# Line 239  Bool_t TrkCluster::IsBad(Int_t nbad){ Line 239  Bool_t TrkCluster::IsBad(Int_t nbad){
239      il = indmax;      il = indmax;
240      ir = indmax;      ir = indmax;
241      for(Int_t i=1; i<nbad; i++){      for(Int_t i=1; i<nbad; i++){
242          if (ir == CLlength && il == 0)break;          if (ir == CLlength-1 && il == 0)break;
243          else if (ir == CLlength && il != 0)il--;          else if (ir == CLlength-1 && il != 0)il--;
244          else if (ir != CLlength && il == 0)ir++;          else if (ir != CLlength-1 && il == 0)ir++;
245          else{          else{
246              if(clsignal[il-1] > clsignal[ir+1])il--;              if(clsignal[il-1] > clsignal[ir+1])il--;
247              else ir++;              else ir++;
# Line 264  Bool_t TrkCluster::IsSaturated(Int_t nba Line 264  Bool_t TrkCluster::IsSaturated(Int_t nba
264      il = indmax;      il = indmax;
265      ir = indmax;      ir = indmax;
266      for(Int_t i=1; i<nbad; i++){      for(Int_t i=1; i<nbad; i++){
267          if (ir == CLlength && il == 0)break;          if (ir == CLlength-1 && il == 0)break;
268          else if (ir == CLlength && il != 0)il--;          else if (ir == CLlength-1 && il != 0)il--;
269          else if (ir != CLlength && il == 0)ir++;          else if (ir != CLlength-1 && il == 0)ir++;
270          else{          else{
271              if(clsignal[il-1] > clsignal[ir+1])il--;              if(clsignal[il-1] > clsignal[ir+1])il--;
272              else ir++;              else ir++;
# Line 291  void TrkCluster::Dump(){ Line 291  void TrkCluster::Dump(){
291      cout << "Position of maximun "<< maxs <<endl;      cout << "Position of maximun "<< maxs <<endl;
292      cout << "Multiplicity        "<< GetMultiplicity() <<endl;      cout << "Multiplicity        "<< GetMultiplicity() <<endl;
293      cout << "Tot signal          "<< GetSignal() << " (ADC channels)"<<endl ;      cout << "Tot signal          "<< GetSignal() << " (ADC channels)"<<endl ;
294      cout << "Signal/Noise        "<< GetSignalToNoise();      cout << "Signal/Noise        "<< GetSignalToNoise()<<endl;
295      cout <<endl<< "Strip signals       ";      cout << "COG                 "<< GetCOG(0)<<endl;;
296        cout << "Strip signals       ";
297      for(Int_t i =0; i<CLlength; i++)cout << " " <<clsignal[i];      for(Int_t i =0; i<CLlength; i++)cout << " " <<clsignal[i];
298      cout <<endl<< "Strip sigmas        ";      cout <<endl<< "Strip sigmas        ";
299      for(Int_t i =0; i<CLlength; i++)cout << " " <<clsigma[i];      for(Int_t i =0; i<CLlength; i++)cout << " " <<clsigma[i];
# Line 431  TrkLevel1::TrkLevel1(){ Line 432  TrkLevel1::TrkLevel1(){
432              cnn[j][i]=0;              cnn[j][i]=0;
433          };          };
434      };      };
435        TrkParams::SetTrackingMode();
436        TrkParams::SetPrecisionFactor();
437        TrkParams::SetStepMin();
438        TrkParams::SetPFA();
439  }  }
440  //--------------------------------------  //--------------------------------------
441  //  //
# Line 463  void TrkLevel1::Dump(){ Line 468  void TrkLevel1::Dump(){
468      for(int i=0; i<this->nclstr(); i++)     ((TrkCluster *)t[i])->Dump();      for(int i=0; i<this->nclstr(); i++)     ((TrkCluster *)t[i])->Dump();
469            
470  }  }
471    /**
472     * \brief Dump processing status
473     */
474    void TrkLevel1::StatusDump(int view){
475        cout << "DSP n. "<<view+1<<" (level1-)status: "<<hex<<showbase<<good[view]<<dec<<endl;    
476    };
477    /**
478     * \brief Check event status
479     *
480     * Check the event status, according to a flag-mask given as input.
481     * Return true if the view passes the check.
482     *
483     * @param view View number (0-11)
484     * @param flagmask Mask of flags to check (eg. flagmask=0x111 no missing packet,
485     *  no crc error, no software alarm)
486     *
487     * @see TrkLevel2 class definition to know how the status flag is defined
488     *
489     */
490    Bool_t TrkLevel1::StatusCheck(int view, int flagmask){
491    
492        if( view<0 || view >= 12)return false;
493        return !(good[view]&flagmask);
494    
495    };
496    
497    
498  //--------------------------------------  //--------------------------------------
499  //  //
500  //  //
# Line 500  void TrkLevel1::SetFromLevel1Struct(cTrk Line 532  void TrkLevel1::SetFromLevel1Struct(cTrk
532              t_cl->clsigma  = new Float_t[t_cl->CLlength];              t_cl->clsigma  = new Float_t[t_cl->CLlength];
533              t_cl->cladc    = new Int_t[t_cl->CLlength];              t_cl->cladc    = new Int_t[t_cl->CLlength];
534              t_cl->clbad    = new Bool_t[t_cl->CLlength];              t_cl->clbad    = new Bool_t[t_cl->CLlength];
535    
536              Int_t index = 0;              Int_t index = 0;
537              for(Int_t is = from; is < to; is++ ){              for(Int_t is = from; is < to; is++ ){
538                  t_cl->clsignal[index] = (Float_t) l1->clsignal[is];                  t_cl->clsignal[index] = (Float_t) l1->clsignal[is];
# Line 873  float* TrkLevel1::GetPfaAbs(TString pfa, Line 906  float* TrkLevel1::GetPfaAbs(TString pfa,
906   * Method to call the F77 routine that performs level1->level2 processing.   * Method to call the F77 routine that performs level1->level2 processing.
907   * The level2 output is stored in a common block, which can be retrieved   * The level2 output is stored in a common block, which can be retrieved
908   * by mean of the method TrkLevel2::SetFromLevel2Struct().   * by mean of the method TrkLevel2::SetFromLevel2Struct().
  * @param pfa Position finding algorythm used to reconstruct the track  
  * Implemented algorythms:  
  * 0  ETA (default)  
  * 1  ---  
  * 2  ETA2  
  * 3  ETA3  
  * 4  ETA4  
  * 10 COG  
  * 11 COG1  
  * 12 COG2  
  * 13 COG3  
  * 14 COG4  
909   * NB If the TrkLevel1 object is readout from a tree, and the   * NB If the TrkLevel1 object is readout from a tree, and the
910   * TrkLevel1::ProcessEvent(int pfa) is used to reprocess the event, attention   * TrkLevel1::ProcessEvent(int pfa) is used to reprocess the event, attention
911   * should be payed to the fact that single clusters (clusters not associated   * should be payed to the fact that single clusters (clusters not associated
912   * with any track) might not be stored. Full reprocessing should be done from   * with any track) might not be stored. Full reprocessing should be done starting
913   * level0 data.   * from level0 data.
914   */   */
915  int TrkLevel1::ProcessEvent(int pfa){  //int TrkLevel1::ProcessEvent(int pfa){
916    int TrkLevel1::ProcessEvent(){
917    
918  //    cout << "int TrkLevel1::ProcessEvent()" << endl;  //    cout << "int TrkLevel1::ProcessEvent()" << endl;
919      TrkParams::Load( );      TrkParams::Load( );
# Line 899  int TrkLevel1::ProcessEvent(int pfa){ Line 921  int TrkLevel1::ProcessEvent(int pfa){
921    
922      GetLevel1Struct();      GetLevel1Struct();
923    
924      analysisflight_(&pfa);  //    analysisflight_(&pfa);
925    //    TrkParams::SetPFA(pfa);
926  //    cout << "...done"<<endl;      analysisflight_();
927    
928      return 1;      return 1;
929    

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.23