/[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.25 by pam-fi, Sat Mar 22 08:32:50 2008 UTC revision 1.28 by pam-ts, Wed Jun 4 07:57:04 2014 UTC
# Line 11  using namespace std; Line 11  using namespace std;
11  extern "C" {  extern "C" {
12                    
13  //      int readetaparam_();  //      int readetaparam_();
14      float cog_(int*,int*);    float cog_(int*,int*);
15      float pfaeta_(int*,float*);    float pfaeta_(int*,float*);
16      float pfaeta2_(int*,float*);    float pfaeta2_(int*,float*);
17      float pfaeta3_(int*,float*);    float pfaeta3_(int*,float*);
18      float pfaeta4_(int*,float*);    float pfaeta4_(int*,float*);
19      float pfaetal_(int*,float*);    float pfaetal_(int*,float*);
20      int   npfastrips_(int*,float*);    float digsat_(int*);
21              int   npfastrips_(int*,float*);
22      
23      float fbad_cog_(int*,int*);
24      float risx_cog_(float*);
25      float risy_cog_(float*);
26  }  }
27  //--------------------------------------  //--------------------------------------
28  //  //
# Line 407  void TrkCluster::GetLevel1Struct(cTrkLev Line 411  void TrkCluster::GetLevel1Struct(cTrkLev
411   *      @param ncog Number of strips to evaluate COG.     *      @param ncog Number of strips to evaluate COG.  
412   * If ncog=0, the COG of the cluster is evaluated according to the cluster multiplicity (defined by the inclusion cut).   * If ncog=0, the COG of the cluster is evaluated according to the cluster multiplicity (defined by the inclusion cut).
413   * If ncog>0, the COG is evaluated using ncog strips, even if they have a negative signal (according to G.Landi)   * If ncog>0, the COG is evaluated using ncog strips, even if they have a negative signal (according to G.Landi)
414     *
415     * (NB TrkCluster::GetLevel1Struct() showld be called first, in order to fill the F77 level1 common with this single cluster)
416   */   */
417  Float_t TrkCluster::GetCOG(Int_t ncog){  Float_t TrkCluster::GetCOG(Int_t ncog){
418                    
419      int ic = 1;      int ic = 1;
420      GetLevel1Struct();      //    GetLevel1Struct(); //Elena: dangerous...
421      return cog_(&ncog,&ic);      return cog_(&ncog,&ic);
422                    
423  };  };
# Line 455  Float_t TrkCluster::GetCOG(Float_t angle Line 461  Float_t TrkCluster::GetCOG(Float_t angle
461   *  @param angle Projected (effective) angle between particle track and detector plane.   *  @param angle Projected (effective) angle between particle track and detector plane.
462   *  @landi flag to apply Landi correction   *  @landi flag to apply Landi correction
463   * Implemented values of neta are 2,3,4. If neta=0, ETA2, ETA3 and ETA4 are applied according to the angle.   * Implemented values of neta are 2,3,4. If neta=0, ETA2, ETA3 and ETA4 are applied according to the angle.
464     * (NB TrkCluster::GetLevel1Struct() showld be called first, in order to fill the F77 level1 common with this single cluster)
465   */   */
466  Float_t TrkCluster::GetETA(Int_t neta, float angle, bool landi){  Float_t TrkCluster::GetETA(Int_t neta, float angle, bool landi){
467                    
# Line 469  Float_t TrkCluster::GetETA(Int_t neta, f Line 476  Float_t TrkCluster::GetETA(Int_t neta, f
476    
477      float ax = angle;      float ax = angle;
478      int ic = 1;      int ic = 1;
479      GetLevel1Struct();      //GetLevel1Struct(); //Elena: dangerous...
480      if(     neta == 0 && !landi) return pfaeta_(&ic,&ax);      if(     neta == 0 && !landi) return pfaeta_(&ic,&ax);
481      else if(neta == 0 && landi ) return pfaetal_(&ic,&ax);      else if(neta == 0 && landi ) return pfaetal_(&ic,&ax);
482      else if(neta == 2          ) return pfaeta2_(&ic,&ax);      else if(neta == 2          ) return pfaeta2_(&ic,&ax);
# Line 481  Float_t TrkCluster::GetETA(Int_t neta, f Line 488  Float_t TrkCluster::GetETA(Int_t neta, f
488  };  };
489    
490  /**  /**
491     * Evaluates the cluster position, in pitch units, relative to the strip
492     *  with the maximum signal (TrkCluster::maxs), by applying the digital
493     *  algorithm for saturated clusters.
494     *
495     *  @return The cluster position (0 also if if no saturated strip is found).
496     *
497     * (NB TrkCluster::GetLevel1Struct() showld be called first, in order to fill the F77 level1 common with this single cluster)
498     */
499    Float_t TrkCluster::GetDigSat() {
500    
501      //  GetLevel1Struct(); //Elena: dangerous...
502      int ic = 1;
503      return digsat_(&ic);
504    
505    }
506    
507    /**
508   * Evaluates the cluster position, in pitch unit, relative to the strip with   * Evaluates the cluster position, in pitch unit, relative to the strip with
509   * the maximum signal (TrkCluster::maxs), by applying the PFA set as default (see TrkParams).   * the maximum signal (TrkCluster::maxs), by applying the PFA set as default (see TrkParams).
510   *  @param angle Projected (effective) angle between particle track and detector plane.   *  @param angle Projected (effective) angle between particle track and detector plane.
# Line 508  Float_t TrkCluster::GetPositionPU(float Line 532  Float_t TrkCluster::GetPositionPU(float
532   * according to the p.f.a.   * according to the p.f.a.
533   * It returns 0 when the COG is used (in this case the number of strip used   * It returns 0 when the COG is used (in this case the number of strip used
534   * equals the multiplicity).   * equals the multiplicity).
535     * (NB TrkCluster::GetLevel1Struct() showld be called first, in order to fill the F77 level1 common with this single cluster)
536   */   */
537  Int_t TrkCluster::GetPFAstrips(float angle){  Int_t TrkCluster::GetPFAstrips(float angle){
538    
539      float ax = angle;      float ax = angle;
540      int ic = 1;      int ic = 1;
541      GetLevel1Struct();      //    GetLevel1Struct(); //Elena: dangerous...
542      return npfastrips_(&ic,&ax);      return npfastrips_(&ic,&ax);
543    
544  }  }
# Line 872  int TrkLevel1::ProcessEvent(){ Line 897  int TrkLevel1::ProcessEvent(){
897    
898  }  }
899    
900    //--------------------------------------
901    //
902    //
903    //--------------------------------------
904    /**
905     * Method to fill a TrkLevel1 object from an existing one, by cleaning low-signal clusters.
906     *
907     */
908    void TrkLevel1::Set(TrkLevel1 *trkl1, float mipCut, float fCut){
909    
910    
911    
912        
913        if(!trkl1)return;
914    
915        //  -------------------------
916        //  ****general variables****
917        //  -------------------------    
918        for(Int_t i=0; i<12 ; i++){
919            good[i] = trkl1->good[i];
920            for(Int_t j=0; j<24 ; j++){
921                cn[j][i]     = trkl1->cn[j][i];
922                cnn[j][i]    = trkl1->cnn[j][i];
923            };
924        };
925        //  -------------------------
926        //  ****cluster array****
927        //  -------------------------    
928    
929        if(Cluster)Cluster->Clear("C");
930        Cluster = new TClonesArray("TrkCluster");
931        TClonesArray &t = *Cluster;
932    
933        int isel=0;
934        for(int icl=0 ; icl< trkl1->GetClusters()->GetEntries(); icl++){
935            TrkCluster *cl = trkl1->GetCluster(icl);
936    
937            float mip = TrkParams::GetMIP(cl->GetLadder()-1,cl->view-1);
938            float smip = cl->GetSignal()/(mip>0.?mip:1.);
939            float smax =  cl->clsignal[cl->indmax]/(mip>0.?mip:1.);
940            if(smax/smip<fCut)continue;
941            if(smip<mipCut)continue;
942            if(smax<0.5*mipCut)continue;
943            
944    
945    
946            new(t[isel]) TrkCluster(*cl); // <<< store cluster
947            isel++;
948        }
949    
950    
951    
952    }
953    
954  ClassImp(TrkLevel1);  ClassImp(TrkLevel1);
955  ClassImp(TrkCluster);  ClassImp(TrkCluster);

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.23