| 53 | // | // | 
| 54 | // | // | 
| 55 | //=============================================================================== | //=============================================================================== | 
|  | void Dump(AcLevel2* ac){ |  | 
|  |  |  | 
|  | cout << "status[0]  :"<< hex << ac->status[0] <<endl; |  | 
|  | cout << "status[1]  :"<< hex << ac->status[1] <<endl; |  | 
|  | cout << "hitmap[0]  :"<< hex << ac->hitmap[0] <<endl; |  | 
|  | cout << "hitmap[1]  :"<< hex << ac->hitmap[1] <<endl; |  | 
|  | cout << "hitstatus[0]  :"<< hex << ac->hitstatus[0] <<endl; |  | 
|  | cout << "hitstatus[1]  :"<< hex << ac->hitstatus[1] <<endl; |  | 
|  | cout << "trigger[0]  :"<< hex << ac->trigger[0] <<endl; |  | 
|  | cout << "trigger[1]  :"<< hex << ac->trigger[1] <<endl; |  | 
|  |  |  | 
|  | } |  | 
|  | void Dump(ToFTrkVar* tof){ |  | 
|  |  |  | 
|  | cout << endl<< "n. tdc hits :"<<tof->npmttdc; |  | 
|  | cout << endl<< "PMTs        :"; |  | 
|  | for(Int_t ip=0; ip< tof->npmttdc; ip++)cout << " "<< tof->pmttdc[ip]; |  | 
|  | cout << endl<< "n. adc hits :"<<tof->npmtadc; |  | 
|  | cout << endl<< "PMTs        :"; |  | 
|  | for(Int_t ip=0; ip< tof->npmtadc; ip++)cout << " "<< tof->pmtadc[ip]; |  | 
|  | cout << endl<< "dedx        :"; |  | 
|  | for(Int_t ib=0; ib< tof->npmtadc; ib++)cout << " "<< tof->dedx[ib]; |  | 
|  | cout << endl<< "beta        :"; |  | 
|  | for(Int_t ib=0; ib<13 ; ib++)cout << " "<< tof->beta[ib]; |  | 
|  | cout << endl<< "xtofpos     :"; |  | 
|  | for(Int_t ib=0; ib<3 ; ib++)cout << " "<< tof->xtofpos[ib]; |  | 
|  | cout << endl<< "ytofpos     :"; |  | 
|  | for(Int_t ib=0; ib<3 ; ib++)cout << " "<<tof->ytofpos[ib]; |  | 
|  | cout << endl; |  | 
|  | } |  | 
|  |  |  | 
|  |  |  | 
|  | //=============================================================================== |  | 
|  | // |  | 
|  | // |  | 
|  | // |  | 
|  | // |  | 
|  | //=============================================================================== |  | 
| 56 | bool Select( PamLevel2* event ){ | bool Select( PamLevel2* event ){ | 
| 57 |  |  | 
|  |  |  | 
|  | //  cout << event->nstrip << " "<<event->npmt() << " " << event->ntrk()<<endl; |  | 
| 58 | //  ----------------------------------------- | //  ----------------------------------------- | 
| 59 | //  +++++++++++++++++++++++++++++++++++++++++ | //  +++++++++++++++++++++++++++++++++++++++++ | 
| 60 | //              CALORIMETER CUTS | //  GENERAL SELECTION CUTS | 
| 61 | //  +++++++++++++++++++++++++++++++++++++++++ | //  +++++++++++++++++++++++++++++++++++++++++ | 
| 62 | //  ----------------------------------------- | //  ----------------------------------------- | 
|  |  |  | 
|  | CaloAxis *x_axis = new CaloAxis(); |  | 
|  | CaloAxis *y_axis = new CaloAxis(); |  | 
|  |  |  | 
|  | if(event->nstrip<60){ |  | 
|  |  |  | 
|  | // -------------------------------- |  | 
|  | // evaluate track axis |  | 
|  | // -------------------------------- |  | 
|  | float rcil = 1.;// tolerance (cm) |  | 
|  | if( !x_axis->FitAxis(event->GetCaloLevel1(),0,rcil) )return 0; |  | 
|  | if( !y_axis->FitAxis(event->GetCaloLevel1(),1,rcil) )return 0; |  | 
|  |  |  | 
|  | if(x_axis->GetN()<4 || y_axis->GetN()<4)return 0; |  | 
|  |  |  | 
|  | float qtrack = x_axis->GetQaxis()+y_axis->GetQaxis(); |  | 
|  | int   ntrack = x_axis->GetN()+y_axis->GetN(); |  | 
|  |  |  | 
|  | float qstrip = qtrack/ntrack; |  | 
|  |  |  | 
|  | // -------------------------------- |  | 
|  | // evaluate total energy release |  | 
|  | // -------------------------------- |  | 
|  | float qtot   = 0; |  | 
|  | int   ntot   = 0; |  | 
|  | qtot = event->qtot; |  | 
|  | ntot = event->nstrip; |  | 
|  |  |  | 
|  |  |  | 
|  | float nratio = 0; |  | 
|  | float qratio = 0; |  | 
|  | if(ntot>0){ |  | 
|  | nratio = (float)ntrack/(float)ntot; |  | 
|  | qratio = qtrack/qtot; |  | 
|  | } |  | 
| 63 |  |  | 
| 64 | //      cout << qtrack << " " << ntrack << " "<< qtot << " "<<ntot<<endl; | //  ------------ | 
| 65 | if(qratio < 0.8)return false; | //  single track | 
| 66 |  | //  ------------ | 
| 67 | }else return false; | if( event->GetNTracks()!=1 ) return false; | 
|  |  |  | 
|  | x_axis->Delete(); |  | 
|  | y_axis->Delete(); |  | 
|  |  |  | 
|  | //  ----------------------------------------- |  | 
|  | //  +++++++++++++++++++++++++++++++++++++++++ |  | 
|  | //                  TOF CUTS |  | 
|  | //  +++++++++++++++++++++++++++++++++++++++++ |  | 
|  | //  ----------------------------------------- |  | 
| 68 |  |  | 
| 69 |  | //  ------------ | 
| 70 |  | //  calorimeter | 
| 71 |  | //  ------------ | 
| 72 |  |  | 
| 73 | //  --------------------------- | //  --------------------------- | 
| 74 | //  one hit paddle on S1 and S2 | //  one hit paddle on S1 S2 S3 | 
| 75 |  | //  no single-PMT hits | 
| 76 | //  --------------------------- | //  --------------------------- | 
| 77 | if( | if( | 
| 78 | event->GetNHitPaddles(0) == 1 && | event->GetNHitPaddles(0) == 1 && | 
| 81 | event->GetNHitPaddles(3) == 1 && | event->GetNHitPaddles(3) == 1 && | 
| 82 | event->GetNHitPaddles(4) == 1 && | event->GetNHitPaddles(4) == 1 && | 
| 83 | event->GetNHitPaddles(5) == 1 && | event->GetNHitPaddles(5) == 1 && | 
| 84 |  | event->npmt() == 12           && | 
| 85 | true | true | 
| 86 | ){;;; | ){;;; | 
| 87 | }else return false; | }else return false; | 
| 88 |  |  | 
| 89 | //  ----------------------------------------- | //  ---------------------------------------------- | 
| 90 | //  +++++++++++++++++++++++++++++++++++++++++ | //  no activity either in main and spare AC boards | 
| 91 | //                  AC CUTS | //  ---------------------------------------------- | 
|  | //  +++++++++++++++++++++++++++++++++++++++++ |  | 
|  | //  ----------------------------------------- |  | 
| 92 | AcLevel2* ac = event->GetAcLevel2(); | AcLevel2* ac = event->GetAcLevel2(); | 
|  |  |  | 
| 93 | if( IsHit("CARD1-M",ac) || IsHit("CARD1-E",ac) )return false; | if( IsHit("CARD1-M",ac) || IsHit("CARD1-E",ac) )return false; | 
| 94 | if( IsHit("CARD2-M",ac) || IsHit("CARD2-E",ac) )return false; | if( IsHit("CARD2-M",ac) || IsHit("CARD2-E",ac) )return false; | 
| 95 | if( IsHit("CARD3-M",ac) || IsHit("CARD3-E",ac) )return false; | if( IsHit("CARD3-M",ac) || IsHit("CARD3-E",ac) )return false; | 
| 104 | if( IsHit("CAS2-M",ac) || IsHit("CAS2-E",ac) )return false; | if( IsHit("CAS2-M",ac) || IsHit("CAS2-E",ac) )return false; | 
| 105 | if( IsHit("CAS3-M",ac) || IsHit("CAS3-E",ac) )return false; | if( IsHit("CAS3-M",ac) || IsHit("CAS3-E",ac) )return false; | 
| 106 | if( IsHit("CAS4-M",ac) || IsHit("CAS4-E",ac) )return false; | if( IsHit("CAS4-M",ac) || IsHit("CAS4-E",ac) )return false; | 
|  |  |  | 
|  | return true; |  | 
|  |  |  | 
|  | } |  | 
| 107 |  |  | 
| 108 |  |  | 
| 109 |  | //  ----------------------------------------- | 
| 110 |  | //  +++++++++++++++++++++++++++++++++++++++++ | 
| 111 |  | //  TRACK SELECTION CUTS | 
| 112 |  | //  +++++++++++++++++++++++++++++++++++++++++ | 
| 113 |  | //  ----------------------------------------- | 
| 114 |  |  | 
| 115 |  | //  ------------------- | 
| 116 |  | //  tracker: | 
| 117 |  | //  - good fit | 
| 118 |  | //  - nx>=4 ny>=3 | 
| 119 |  | //  - 5-plane lever-arm | 
| 120 |  | //  tof: | 
| 121 |  | //  - beta>0 | 
| 122 |  | //  calorimeter: | 
| 123 |  | //  - non interacting | 
| 124 |  | //  ------------------- | 
| 125 |  | PamTrack *track = event->GetTrack(0); | 
| 126 |  | bool TRACK__OK = false; | 
| 127 |  | if( | 
| 128 |  | track->chi2 >0    && | 
| 129 |  | track->GetNX()>=4 && | 
| 130 |  | track->GetNY()>=3 && | 
| 131 |  | ((track->XGood(0) && track->XGood(5)) || (track->XGood(0) && track->XGood(4)) || (track->XGood(1) && track->XGood(5)) )  && | 
| 132 |  | track->beta[12]>0 && | 
| 133 |  | true | 
| 134 |  | ){ | 
| 135 |  |  | 
| 136 |  | if(event->qtot>0){ | 
| 137 |  | if(track->qtrack/event->qtot <0.8)TRACK__OK = false; | 
| 138 |  | } | 
| 139 |  |  | 
| 140 |  | TRACK__OK = true; | 
| 141 |  | }; | 
| 142 |  | delete track; | 
| 143 |  |  | 
| 144 |  | if(!TRACK__OK)return false; | 
| 145 |  |  | 
| 146 |  | return true; | 
| 147 |  |  | 
| 148 |  | } |