--- PamelaLevel2/doc/examples/My-Selection-0.cpp 2007/01/03 13:28:49 1.1 +++ PamelaLevel2/doc/examples/My-Selection-0.cpp 2007/01/15 11:51:39 1.2 @@ -1,3 +1,10 @@ +////////////////////////////////////////////////////////// +// Selection of events with non-interacting pattern +// in the calorimeter. +// The selection is independent from the track variables +// (for tracker-efficiency studies) +////////////////////////////////////////////////////////// + #if !defined(__CINT__) || defined(__MAKECINT__) @@ -94,57 +101,57 @@ bool Select( PamLevel2* event ){ - if(event->ntrk() ==0 )return false; + if(event->GetTrkLevel2()->ntrk() ==0 )return false; -// cout << event->nstrip << " "<npmt() << " " << event->ntrk()<GetCaloLevel2()->nstrip << " "<GetToFLevel2()->npmt() << " " << event->GetTrkLevel2()->ntrk()<nstrip<60){ + if(event->GetCaloLevel2()->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; -// } + // -------------------------------- + // 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->GetCaloLevel2()->qtot; + ntot = event->GetCaloLevel2()->nstrip; + + + float nratio = 0; + float qratio = 0; + if(ntot>0){ + nratio = (float)ntrack/(float)ntot; + qratio = qtrack/qtot; + } -// // cout << qtrack << " " << ntrack << " "<< qtot << " "<Delete(); -// y_axis->Delete(); + x_axis->Delete(); + y_axis->Delete(); // ----------------------------------------- // +++++++++++++++++++++++++++++++++++++++++ @@ -152,41 +159,41 @@ // +++++++++++++++++++++++++++++++++++++++++ // ----------------------------------------- - // --------------------------- - // one hit paddle on S1 and S2 - // --------------------------- -// if( -// event->GetNHitPaddles(0) == 1 && -// event->GetNHitPaddles(1) == 1 && -// event->GetNHitPaddles(2) == 1 && -// event->GetNHitPaddles(3) == 1 && -// event->GetNHitPaddles(4) == 1 && -// event->GetNHitPaddles(5) == 1 && -// true -// ){;;; -// }else return false; +// --------------------------- +// one hit paddle on S1 and S2 +// --------------------------- + if( + event->GetToFLevel2()->GetNHitPaddles(0) == 1 && + event->GetToFLevel2()->GetNHitPaddles(1) == 1 && + event->GetToFLevel2()->GetNHitPaddles(2) == 1 && + event->GetToFLevel2()->GetNHitPaddles(3) == 1 && + event->GetToFLevel2()->GetNHitPaddles(4) == 1 && + event->GetToFLevel2()->GetNHitPaddles(5) == 1 && + true + ){;;; + }else return false; // ----------------------------------------- // +++++++++++++++++++++++++++++++++++++++++ // AC CUTS // +++++++++++++++++++++++++++++++++++++++++ // ----------------------------------------- -// AcLevel2* ac = event->GetAcLevel2(); + AcLevel2* ac = event->GetAcLevel2(); -// if( IsHit("CARD1-M",ac) || IsHit("CARD1-E",ac) )return false; -// if( IsHit("CARD2-M",ac) || IsHit("CARD2-E",ac) )return false; -// if( IsHit("CARD3-M",ac) || IsHit("CARD3-E",ac) )return false; -// if( IsHit("CARD4-M",ac) || IsHit("CARD4-E",ac) )return false; - -// if( IsHit("CAT1-M",ac) || IsHit("CAT1-E",ac) )return false; -// if( IsHit("CAT2-M",ac) || IsHit("CAT2-E",ac) )return false; -// if( IsHit("CAT3-M",ac) || IsHit("CAT3-E",ac) )return false; -// if( IsHit("CAT4-M",ac) || IsHit("CAT4-E",ac) )return false; - -// if( IsHit("CAS1-M",ac) || IsHit("CAS1-E",ac) )return false; -// if( IsHit("CAS2-M",ac) || IsHit("CAS2-E",ac) )return false; -// if( IsHit("CAS3-M",ac) || IsHit("CAS3-E",ac) )return false; -// if( IsHit("CAS4-M",ac) || IsHit("CAS4-E",ac) )return false; + if( IsHit("CARD1-M",ac) || IsHit("CARD1-E",ac) )return false; + if( IsHit("CARD2-M",ac) || IsHit("CARD2-E",ac) )return false; + if( IsHit("CARD3-M",ac) || IsHit("CARD3-E",ac) )return false; + if( IsHit("CARD4-M",ac) || IsHit("CARD4-E",ac) )return false; + + if( IsHit("CAT1-M",ac) || IsHit("CAT1-E",ac) )return false; + if( IsHit("CAT2-M",ac) || IsHit("CAT2-E",ac) )return false; + if( IsHit("CAT3-M",ac) || IsHit("CAT3-E",ac) )return false; + if( IsHit("CAT4-M",ac) || IsHit("CAT4-E",ac) )return false; + + if( IsHit("CAS1-M",ac) || IsHit("CAS1-E",ac) )return false; + if( IsHit("CAS2-M",ac) || IsHit("CAS2-E",ac) )return false; + if( IsHit("CAS3-M",ac) || IsHit("CAS3-E",ac) )return false; + if( IsHit("CAS4-M",ac) || IsHit("CAS4-E",ac) )return false; return true;