/[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.11 by mocchiut, Thu Dec 18 20:57:58 2008 UTC revision 1.14 by mocchiut, Thu Sep 10 12:52:51 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 150  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() ){
170        if ( debug ) printf(" I am here, we have orbital infos \n");
171      if ( L2->GetOrbitalInfo()->pkt_num != PKT || L2->GetOrbitalInfo()->OBT != OBT || L2->GetOrbitalInfo()->absTime != atime || sel != ssel ){      if ( L2->GetOrbitalInfo()->pkt_num != PKT || L2->GetOrbitalInfo()->OBT != OBT || L2->GetOrbitalInfo()->absTime != atime || sel != ssel ){
172        newentry = true;        newentry = true;
173        OBT = L2->GetOrbitalInfo()->OBT;        OBT = L2->GetOrbitalInfo()->OBT;
# Line 506  void CaloPreSampler::Process(){ Line 521  void CaloPreSampler::Process(){
521        if ( debug ) printf(" Selftrigger: problems with event \n");        if ( debug ) printf(" Selftrigger: problems with event \n");
522      };      };
523    };    };
524    //  //   //
525    // Clear structures used to communicate with fortran  //   // Clear structures used to communicate with fortran
526    //  //   //
527    event->ClearStructs();  //   event->ClearStructs();
528    // ELENA: moved @ beginning
529    //    //
530    //    //
531    //    //
# Line 517  void CaloPreSampler::Process(){ Line 533  void CaloPreSampler::Process(){
533    if ( debug ) printf(" exit \n");    if ( debug ) printf(" exit \n");
534    //    //
535  }  }
536    
537    //
538    // Method to add a calorimeter track, evaluated around a tracker track defined by a status vector.
539    // (can be used to evaluate the calorimeter track around an arbitrary axis, by setting the status vector with zero deflection )
540    //
541    //
542    CaloTrkVar* CaloPreSampler::AddCaloTrkVar(float *al,int trktag){
543    
544        int ntrkentry = pcalo->ntrk();
545        //
546        for (Int_t nt=0; nt < ntrkentry; nt++){  
547            if( pcalo->GetCaloTrkVar(nt)->trkseqno == trktag){
548                cout << " CaloTrkVar* CaloPreSampler::AddCaloTrkVar(float *al,int trktag)"<<endl;
549                cout << " --> trktag = "<<trktag<<" already defined "<<endl;
550                return NULL;
551            }
552        }
553        //
554        event->clevel1->good2 = 1; //is a trk track
555        event->clevel1->trkchi2 = 0;
556        event->clevel1->hzn = 0;
557        //
558        // Copy the alpha vector in the input structure
559        //
560        for (Int_t e = 0; e < 5 ; e++){
561            event->clevel1->al_p[e][0] = al[e];
562        };    
563        //
564        // Get tracker related variables for this track
565        //
566        if ( debug ) printf("track %i Call GetTrkVar() \n",trktag);
567        event->GetTrkVar();
568        if ( debug ) printf(" event->clevel2->dX0l %f \n",event->clevel2->dX0l);
569        //
570        // Save tracker track sequence number
571        //  
572        event->trkseqno = trktag;
573        //
574        // Copy values in the class ca from the structure clevel2
575        //
576        if ( debug ) printf("track %i Call FillTrkVar() \n",trktag);
577        event->FillTrkVar(pcalo,ntrkentry);
578    
579        return pcalo->GetCaloTrkVar(ntrkentry);
580        
581    
582    };//ELENA

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.23