/[PAMELA software]/calo/flight/CaloPreSampler/src/CaloPreSampler.cpp
ViewVC logotype

Diff of /calo/flight/CaloPreSampler/src/CaloPreSampler.cpp

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

revision 1.10 by mocchiut, Wed May 28 08:31:46 2008 UTC revision 1.13 by mocchiut, Mon Jul 27 13:58:58 2009 UTC
# Line 42  CaloPreSampler::CaloPreSampler(PamLevel2 Line 42  CaloPreSampler::CaloPreSampler(PamLevel2
42    nox = false;    nox = false;
43    noy = false;    noy = false;
44    forcecalo = false;    forcecalo = false;
45      forcefitmode = -1;
46    memset(mask,0,2*22*sizeof(Int_t));    memset(mask,0,2*22*sizeof(Int_t));
47    //    //
48    Clear();    Clear();
# Line 95  void CaloPreSampler::SetNoWcalo(Int_t n) Line 96  void CaloPreSampler::SetNoWcalo(Int_t n)
96    };    };
97  }  }
98    
99    void CaloPreSampler::SplitInto(Int_t NoWpreSampler, Int_t NoWcalo){
100      this->SetNoWcalo(0);
101      this->SetNoWpreSampler(0);
102      if ( NoWpreSampler < NoWcalo ){
103            this->SetNoWpreSampler(NoWpreSampler);
104            this->SetNoWcalo(NoWcalo);
105      } else {
106            this->SetNoWcalo(NoWcalo);
107            this->SetNoWpreSampler(NoWpreSampler);
108      };
109    }
110    
111  void CaloPreSampler::Clear(){  void CaloPreSampler::Clear(){
112    //    //
113    pcalo->Clear();    pcalo->Clear();
# Line 138  void CaloPreSampler::Process(){ Line 151  void CaloPreSampler::Process(){
151      return;      return;
152    };    };
153    //    //
154      // Clear structures used to communicate with fortran
155      //
156      event->ClearStructs();//ELENA
157      if ( forcefitmode > 0 ){
158        if ( forcefitmode != 1000 && forcefitmode != 1001 && forcefitmode != 1002 ){
159          printf(" ERROR! forcefitmode=%i \n Use forcefitmode = 1000 for fit mode 0, 1001 fit mode 1, 1002 fit mode 3\n",forcefitmode);
160          forcefitmode = -1;
161        } else {
162          event->clevel2->fmode[0] = forcefitmode;
163          event->clevel2->fmode[1] = forcefitmode;
164        };
165      };
166      //
167    Bool_t newentry = false;    Bool_t newentry = false;
168    //    //
169    if ( L2->IsORB() ){    if ( L2->IsORB() ){
# Line 494  void CaloPreSampler::Process(){ Line 520  void CaloPreSampler::Process(){
520        if ( debug ) printf(" Selftrigger: problems with event \n");        if ( debug ) printf(" Selftrigger: problems with event \n");
521      };      };
522    };    };
523    //  //   //
524    // Clear structures used to communicate with fortran  //   // Clear structures used to communicate with fortran
525    //  //   //
526    event->ClearStructs();  //   event->ClearStructs();
527    // ELENA: moved @ beginning
528    //    //
529    //    //
530    //    //
# Line 505  void CaloPreSampler::Process(){ Line 532  void CaloPreSampler::Process(){
532    if ( debug ) printf(" exit \n");    if ( debug ) printf(" exit \n");
533    //    //
534  }  }
535    
536    //
537    // Method to add a calorimeter track, evaluated around a tracker track defined by a status vector.
538    // (can be used to evaluate the calorimeter track around an arbitrary axis, by setting the status vector with zero deflection )
539    //
540    //
541    CaloTrkVar* CaloPreSampler::AddCaloTrkVar(float *al,int trktag){
542    
543        int ntrkentry = pcalo->ntrk();
544        //
545        for (Int_t nt=0; nt < ntrkentry; nt++){  
546            if( pcalo->GetCaloTrkVar(nt)->trkseqno == trktag){
547                cout << " CaloTrkVar* CaloPreSampler::AddCaloTrkVar(float *al,int trktag)"<<endl;
548                cout << " --> trktag = "<<trktag<<" already defined "<<endl;
549                return NULL;
550            }
551        }
552        //
553        event->clevel1->good2 = 1; //is a trk track
554        event->clevel1->trkchi2 = 0;
555        event->clevel1->hzn = 0;
556        //
557        // Copy the alpha vector in the input structure
558        //
559        for (Int_t e = 0; e < 5 ; e++){
560            event->clevel1->al_p[e][0] = al[e];
561        };    
562        //
563        // Get tracker related variables for this track
564        //
565        if ( debug ) printf("track %i Call GetTrkVar() \n",trktag);
566        event->GetTrkVar();
567        if ( debug ) printf(" event->clevel2->dX0l %f \n",event->clevel2->dX0l);
568        //
569        // Save tracker track sequence number
570        //  
571        event->trkseqno = trktag;
572        //
573        // Copy values in the class ca from the structure clevel2
574        //
575        if ( debug ) printf("track %i Call FillTrkVar() \n",trktag);
576        event->FillTrkVar(pcalo,ntrkentry);
577    
578        return pcalo->GetCaloTrkVar(ntrkentry);
579        
580    
581    };//ELENA

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.23