--- PamCut/TofCuts/TofPatternCut/TofPatternCut.cpp 2009/05/27 13:30:09 1.1 +++ PamCut/TofCuts/TofPatternCut/TofPatternCut.cpp 2010/03/18 14:44:11 1.2 @@ -25,46 +25,27 @@ if (!tof) return (0); -#ifdef DEBUGPAMCUT - cout << ">>> TofPatternCut CHECK <<<" << endl; -#endif - bool TOF__OK = false; -#ifdef DEBUGPAMCUT - cout << "Check topology:" << endl; - for (int ip = 0; ip < 6; ip++) - cout << "plane " << ip << " n.hit paddles " << tofl2->GetNHitPaddles(ip) << endl; - for (int ip = 0; ip < 6; ip++) - cout << "plane " << ip << " n.hit PMTs outside track " << GetNHitPMTsOutsideTrack(event, ip) << endl; -#endif - - // ----------------------------------------- - // at least one hit paddle on both S1 and S2 - // ----------------------------------------- if ( - //----------------------------------- - // not more than 1 paddle per layer - //----------------------------------- - tofl2 && tofl2->GetNHitPaddles(0) <= 1 && //S11 + //----------------------------------- + // (1) no more than 1 paddle on S11, S12, S21, S22 + //----------------------------------- + tofl2 && tofl2->GetNHitPaddles(0) <= 1 && //S11 tofl2->GetNHitPaddles(1) <= 1 && //S12 tofl2->GetNHitPaddles(2) <= 1 && //S21 tofl2->GetNHitPaddles(3) <= 1 && //S22 // tofl2->GetNHitPaddles(4) <= 1 && //S31 // tofl2->GetNHitPaddles(5) <= 1 && //S32 //----------------------------------- - // at least 1 paddle per plane + // (2) at least 1 hit paddle on S1, S2 //----------------------------------- (tofl2->GetNHitPaddles(0) == 1 || tofl2->GetNHitPaddles(1) == 1) && //S1 (tofl2->GetNHitPaddles(2) == 1 || tofl2->GetNHitPaddles(3) == 1) && //S2 // (tofl2->GetNHitPaddles(4)==1 || tofl2->GetNHitPaddles(5)==1) && //S3 //----------------------------------- - // n.hit pmts outside track + // (3) less than 3 hit pmts outside track on S11,S12 //----------------------------------- - // GetHitPMTsOutsideTrack(event,0)<2 && //S11 //troppo (puo` succedere ) - // GetHitPMTsOutsideTrack(event,1)<2 && //S12 - // GetHitPMTsOutsideTrack(event,2)<2 && //S21 - // GetHitPMTsOutsideTrack(event,3)<2 && //S22 GetNHitPMTsOutsideTrack(event, 0) < 3 && //S11 GetNHitPMTsOutsideTrack(event, 1) < 3 && //S12 // GetHitPMTsOutsideTrack(event,2)<3 && //S21 @@ -73,27 +54,17 @@ TOF__OK = true; if (!TOF__OK) { -#ifdef DEBUGPAMCUT - cout << "(((DISCARDED)))" << endl; -#endif return (0); }; -#ifdef DEBUGPAMCUT - cout << "--> OK" << endl; - cout << "Check track concistency:" << endl; -#endif - // ----------------------------------------------- - // the hit paddles MUST be associated to the track - // (in collaborazione con wolfgang) + // (4) for S11,S12,S21,S22: if there is a hit paddle, it MUST be associated to the track (done with Wolfgang help) // ----------------------------------------------- // // first build the map of hit PMTs along the track - // and discard the event if there is an hit paddle, + // and discard the event if there is a hit paddle, // but it is not the one associated to the track // - int hitplane[] = { 0, 0, 0, 0, 0, 0 }; int hitpaddle[] = { -1, -1, -1, -1, -1, -1 }; for (Int_t ip = 0; ip < tof->npmttdc; ip++) {//loop over tdc hits associated to the track @@ -104,10 +75,6 @@ tofl2->GetPMTName(id, iplane, ipaddle, ipmt); if (tof->tdcflag[ip] == 0) { hitplane[iplane] = 1; //there is a true tdc signal associated to the track -#ifdef DEBUGPAMCUT - if (hitpaddle[iplane] >= 0 && hitpaddle[iplane] != ipaddle) - cout << "ORRORE!!!!" << endl; -#endif hitpaddle[iplane] = ipaddle;//store the id of the paddle associated to the track // // @@ -115,10 +82,6 @@ if (tofl2->GetNHitPaddles(iplane) > 0 && //if there is a hit paddle in this plane... !tofl2->HitPaddle(iplane, hitpaddle[iplane]) && //... and the paddle associated to the track is not hit true) { -#ifdef DEBUGPAMCUT - cout << "hit plane " << iplane << " -- track PMT " << hitpaddle[iplane] << " is not hit " << endl; - cout << "(((DISCARDED)))" << endl; -#endif return (0);//discard the event } } @@ -131,44 +94,10 @@ if (hitplane[iplane] == 0 && //if there are no PMTs associated to the track... tofl2->GetNHitPaddles(iplane) > 0 && //...and the plane has hit paddles true) { -#ifdef DEBUGPAMCUT - cout << "hit plane " << iplane << " has no PMTs associated to the track " << endl; - cout << "(((DISCARDED)))" << endl; -#endif return (0);//discard the event } } - // - // forse non c'e` bisogno di tutto cio`? - // - // for(int iplane=0; iplane<4; iplane++){//loop over S11/S12/S21/S22 - // //retrieve the id of the paddle traversed by the track - // // (...there is some tolerance...) - // int ipaddle = tofl2->GetPaddleIdOfTrack(tof->xtr_tof[iplane],tof->ytr_tof[iplane],iplane); - // //check if the traversed paddle is hit - // bool OK = true; - // if( - // tofl2->GetNHitPaddles(iplane)>0 &&//if there is a hit paddle in this plane... - // !tofl2->HitPaddle(iplane,ipaddle) && //...and the paddle traversed by the track is not hit - // true)OK = false;//..discard the event - // /// hence try to recover some events... - // if( - // tofl2->GetNHitPaddles(iplane)>0 &&//if there is a hit paddle... - // ipaddle==-1 &&//...and the track does not traverse any paddle... - // tofl2->HitPaddle(iplane,hitpaddle[iplane]) &&//... BUT there are tdc signals belonging to a hit paddle - // true)OK=true;//recover - - // if(!OK)return (0); - - // } - - // if( !TOF__OK )return (0); - -#ifdef DEBUGPAMCUT - cout << "--> OK" << endl; -#endif - return CUTOK; //good pattern }