示例#1
0
void VandleProcessor::AnalyzeStarts(void) {
    for (BarMap::iterator it = bars_.begin(); it !=  bars_.end(); it++) {
        TimingDefs::TimingIdentifier barId = (*it).first;
        BarDetector bar = (*it).second;

        if(!bar.GetHasEvent())
            continue;

        unsigned int histTypeOffset = ReturnOffset(bar.GetType());
        unsigned int barLoc = barId.first;
        TimingCalibration cal = bar.GetCalibration();

        for(TimingMap::iterator itStart = starts_.begin();
        itStart != starts_.end(); itStart++) {
            if(!(*itStart).second.GetIsValidData())
                continue;

            unsigned int startLoc = (*itStart).first.first;
            unsigned int barPlusStartLoc = barLoc*numStarts_ + startLoc;
            HighResTimingData start = (*itStart).second;

            double tofOffset = cal.GetTofOffset(startLoc);
            double tof = bar.GetWalkCorTimeAve() -
                start.GetWalkCorrectedTime() + tofOffset;

            double corTof =
                CorrectTOF(tof, bar.GetFlightPath(), cal.GetZ0());

            plot(DD_TOFBARS+histTypeOffset, tof*plotMult_+plotOffset_, barPlusStartLoc);
            plot(DD_TQDCAVEVSTOF+histTypeOffset, tof*plotMult_+plotOffset_, bar.GetQdc());

            plot(DD_CORTOFBARS, corTof*plotMult_+plotOffset_, barPlusStartLoc);
            plot(DD_TQDCAVEVSCORTOF+histTypeOffset, corTof*plotMult_+plotOffset_,
                 bar.GetQdc());

            if (geSummary_) {
                if (geSummary_->GetMult() > 0) {
                    const vector<ChanEvent *> &geList = geSummary_->GetList();
                    for (vector<ChanEvent *>::const_iterator itGe = geList.begin();
                        itGe != geList.end(); itGe++) {
                        double calEnergy = (*itGe)->GetCalEnergy();
                        plot(DD_GAMMAENERGYVSTOF+histTypeOffset, calEnergy, tof);
                    }
                } else {
                    plot(DD_TQDCAVEVSTOF_VETO+histTypeOffset, tof, bar.GetQdc());
                    plot(DD_TOFBARS_VETO+histTypeOffset, tof, barPlusStartLoc);
                }
            }
        } // for(TimingMap::iterator itStart
    } //(BarMap::iterator itBar
} //void VandleProcessor::AnalyzeData
示例#2
0
void VandleProcessor::FillVandleOnlyHists(void) {
    for(BarMap::const_iterator it = bars_.begin(); it != bars_.end(); it++) {
        TimingDefs::TimingIdentifier barId = (*it).first;
        BarDetector bar = (*it).second;
        unsigned int OFFSET = ReturnOffset(barId.second);

        plot(DD_TQDCBARS + OFFSET,
             bar.GetLeftSide().GetTraceQdc(), barId.first*2);
        plot(DD_MAXIMUMBARS + OFFSET,
             bar.GetLeftSide().GetMaximumValue(), barId.first*2);
        plot(DD_TQDCBARS + OFFSET,
             bar.GetRightSide().GetTraceQdc(), barId.first*2+1);
        plot(DD_MAXIMUMBARS + OFFSET,
             bar.GetRightSide().GetMaximumValue(), barId.first*2+1);
        plot(DD_TIMEDIFFBARS+OFFSET,
            bar.GetTimeDifference()*plotMult_+plotOffset_, barId.first);
    }
}
示例#3
0
bool IS600Processor::Process(RawEvent &event) {
    if (!EventProcessor::Process(event))
        return(false);
    double plotMult_ = 2;
    double plotOffset_ = 1000;

    BarMap vbars, betas;
    map<unsigned int, pair<double,double> > lrtBetas;
    vector<ChanEvent*> geEvts;
    vector<vector<AddBackEvent> > geAddback;

    if(event.GetSummary("vandle")->GetList().size() != 0)
        vbars = ((VandleProcessor*)DetectorDriver::get()->
            GetProcessor("VandleProcessor"))->GetBars();
    if(event.GetSummary("beta:double")->GetList().size() != 0) {
        betas = ((DoubleBetaProcessor*)DetectorDriver::get()->
            GetProcessor("DoubleBetaProcessor"))->GetBars();
        lrtBetas = ((DoubleBetaProcessor*)DetectorDriver::get()->
            GetProcessor("DoubleBetaProcessor"))->GetLowResBars();
    }
    if(event.GetSummary("ge")->GetList().size() != 0) {
        geEvts = ((GeProcessor*)DetectorDriver::get()->
            GetProcessor("GeProcessor"))->GetGeEvents();
        geAddback = ((GeProcessor*)DetectorDriver::get()->
            GetProcessor("GeProcessor"))->GetAddbackEvents();
    }
    static const vector<ChanEvent*> &labr3Evts =
	event.GetSummary("labr3:mrbig")->GetList();

#ifdef useroot
    vsize_->Fill(vbars.size());
#endif

    //Obtain some useful logic statuses
    double lastProtonTime =
	TreeCorrelator::get()->place("logic_t1_0")->last().time;
    bool isTapeMoving = TreeCorrelator::get()->place("TapeMove")->status();

    int bananaNum = 2;
    bool hasMultOne = vbars.size() == 1;
    bool hasMultTwo = vbars.size() == 2;
    //bool isFirst = true;

    plot(DD_DEBUGGING3, vbars.size());

    //Begin processing for VANDLE bars
    for (BarMap::iterator it = vbars.begin(); it !=  vbars.end(); it++) {
        TimingDefs::TimingIdentifier barId = (*it).first;
        BarDetector bar = (*it).second;

        if(!bar.GetHasEvent() || bar.GetType() == "small")
            continue;

        unsigned int barLoc = barId.first;
        TimingCalibration cal = bar.GetCalibration();

        for(BarMap::iterator itStart = betas.begin();
	    itStart != betas.end(); itStart++) {
	    unsigned int startLoc = (*itStart).first.first;
            BarDetector start = (*itStart).second;
            if(!start.GetHasEvent())
                continue;

            double tofOffset = cal.GetTofOffset(startLoc);
            double tof = bar.GetCorTimeAve() -
                start.GetCorTimeAve() + tofOffset;

            double corTof =
                ((VandleProcessor*)DetectorDriver::get()->
		 GetProcessor("VandleProcessor"))->
		CorrectTOF(tof, bar.GetFlightPath(), cal.GetZ0());

	    bool inPeel = histo.BananaTest(bananaNum,
            corTof*plotMult_+plotOffset_,
            bar.GetQdc());
	    bool isLowStart = start.GetQdc() < 300;

	    *outstream << tof << " " << bar.GetQdc() << endl;
#ifdef useroot
        qdctof_->Fill(tof,bar.GetQdc());
        qdc_ = bar.GetQdc();
        tof_ = tof;
        roottree_->Fill();
        qdc_ = tof_ = -9999;
#endif

	    plot(DD_DEBUGGING1, tof*plotMult_+plotOffset_, bar.GetQdc());
	    if(!isTapeMoving && !isLowStart)
		plot(DD_DEBUGGING0, corTof*plotMult_+plotOffset_,bar.GetQdc());
	    if(hasMultOne)
		plot(DD_DEBUGGING4, corTof*plotMult_+plotOffset_, bar.GetQdc());

	    ///Starting to look for 2n coincidences in VANDLE
	    BarMap::iterator itTemp = it;
	    itTemp++;

	    for (BarMap::iterator it2 = itTemp; it2 !=  vbars.end(); it2++) {
		TimingDefs::TimingIdentifier barId2 = (*it2).first;
		BarDetector bar2 = (*it2).second;

		if(!bar.GetHasEvent())
		    continue;

		unsigned int barLoc2 = barId2.first;

		bool isAdjacent = abs((int)barLoc2 - (int)barLoc) < 1;

		TimingCalibration cal2 = bar2.GetCalibration();

		double tofOffset2 = cal2.GetTofOffset(startLoc);
		double tof2 = bar2.GetCorTimeAve() -
		    start.GetCorTimeAve() + tofOffset2;

		double corTof2 =
		    ((VandleProcessor*)DetectorDriver::get()->
		     GetProcessor("VandleProcessor"))->
		    CorrectTOF(tof2, bar2.GetFlightPath(), cal2.GetZ0());

		bool inPeel2 = histo.BananaTest(bananaNum,
						corTof2*plotMult_+plotOffset_,
						bar2.GetQdc());

		if(hasMultTwo && inPeel && inPeel2 && !isAdjacent) {
		    plot(DD_DEBUGGING5, corTof*plotMult_+plotOffset_,
			 corTof2*plotMult_+plotOffset_);
		    plot(DD_DEBUGGING5, corTof2*plotMult_+plotOffset_,
			 corTof*plotMult_+plotOffset_);
		}
	    }
	    ///End 2n coincidence routine

	    // if (geSummary_ && notPrompt && hasMultOne) {
            //     if (geSummary_->GetMult() > 0) {
            //         const vector<ChanEvent *> &geList = geSummary_->GetList();
            //         for (vector<ChanEvent *>::const_iterator itGe = geList.begin();
            //             itGe != geList.end(); itGe++) {
            //             double calEnergy = (*itGe)->GetCalEnergy();
	    // 		plot(DD_DEBUGGING2, calEnergy, corTof*plotMult_+plotOffset_);
            //         }
            //     } else {
	    // 	  //plot(DD_TQDCAVEVSTOF_VETO+histTypeOffset, tof, bar.GetQdc());
	    // 	  //plot(DD_TOFBARS_VETO+histTypeOffset, tof, barPlusStartLoc);
            //     }
            //}
        } // for(TimingMap::iterator itStart
    } //(BarMap::iterator itBar
    //End processing for VANDLE bars

    //-------------- LaBr3 Processing ---------------
    for(vector<ChanEvent*>::const_iterator it = labr3Evts.begin();
	it != labr3Evts.end(); it++)
	plot(DD_DEBUGGING6, (*it)->GetEnergy());


    //------------------ Double Beta Processing --------------
    for(map<unsigned int, pair<double,double> >::iterator it = lrtBetas.begin();
	it != lrtBetas.end(); it++)
	plot(DD_PROTONBETA2TDIFF_VS_BETA2EN, it->second.second,
	     (it->second.first - lastProtonTime) /
	     (10e-3/Globals::get()->clockInSeconds()) );


    //----------------- GE Processing -------------------
    bool hasBeta = TreeCorrelator::get()->place("Beta")->status();
    double clockInSeconds = Globals::get()->clockInSeconds();
    // plot with 10 ms bins
    const double plotResolution = 10e-3 / clockInSeconds;

    for (vector<ChanEvent*>::iterator it1 = geEvts.begin();
	 it1 != geEvts.end(); ++it1) {
        ChanEvent *chan = *it1;

        double gEnergy = chan->GetCalEnergy();
        double gTime   = chan->GetCorrectedTime();
        if (gEnergy < 10.) //hard coded fix later.
            continue;

        plot(D_ENERGY, gEnergy);
	if(hasBeta)
	    plot(D_ENERGYBETA, gEnergy);
	plot(DD_PROTONGAMMATDIFF_VS_GAMMAEN, gEnergy ,
	     (gTime - lastProtonTime) / plotResolution) ;
    }

    EndProcess();
    return(true);
}
bool WalkVandleBetaProcessor::Process(RawEvent &event) {
    if (!EventProcessor::Process(event))
        return (false);
    if (!VandleProcessor::Process(event))
        return (false);

    for (BarMap::iterator it = bars_.begin(); it != bars_.end(); it++) {
        TimingDefs::TimingIdentifier barId = (*it).first;
        BarDetector bar = (*it).second;
        if (!bar.GetHasEvent())
            continue;

        unsigned int barLoc = barId.first;
        bool isLower = barLoc > 6 && barLoc < 16;
        if (!isLower)
            continue;

        TimingCalibration cal = bar.GetCalibration();

        if (barLoc == 12) {
            plot(DD_DEBUGGING4, bar.GetLeftSide().GetTraceQdc(), 0);
            plot(DD_DEBUGGING4, bar.GetRightSide().GetTraceQdc(), 1);
            if (bar.GetLeftSide().GetTraceQdc() > 1500)
                plot(DD_DEBUGGING5,
                     bar.GetWalkCorTimeDiff() * plotMult_ + plotOffset_,
                     bar.GetRightSide().GetTraceQdc());
            if (bar.GetRightSide().GetTraceQdc() > 1500)
                plot(DD_DEBUGGING6,
                     bar.GetWalkCorTimeDiff() * plotMult_ + plotOffset_,
                     bar.GetLeftSide().GetTraceQdc());
            plot(DD_DEBUGGING7,
                 bar.GetWalkCorTimeDiff() * plotMult_ + plotOffset_,
                 bar.GetRightSide().GetTraceQdc());
            plot(DD_DEBUGGING8,
                 bar.GetTimeDifference() * plotMult_ + plotOffset_,
                 bar.GetRightSide().GetTraceQdc());
        }


        for (TimingMap::iterator itStart = starts_.begin();
             itStart != starts_.end(); itStart++) {
            HighResTimingData start = (*itStart).second;
            if (!start.GetIsValidData())
                continue;

            unsigned int startLoc = (*itStart).first.first;

            double tofOffset = cal.GetTofOffset(startLoc);
            double tofBarWalkCor = bar.GetWalkCorTimeAve() -
                                   start.GetWalkCorrectedTime() + tofOffset;
            double tofBarAve = bar.GetTimeAverage() -
                               start.GetWalkCorrectedTime() + tofOffset;

            double thresh = 1500;
            if (startLoc == 0) {
                plot(DD_DEBUGGING2, tofBarWalkCor * plotMult_ + plotOffset_,
                     bar.GetQdc());
                plot(DD_DEBUGGING3, tofBarAve * plotMult_ + plotOffset_,
                     bar.GetQdc());

                if (bar.GetQdc() > thresh) {
                    plot(DD_DEBUGGING0, tofBarWalkCor * plotMult_ + plotOffset_,
                         start.GetPixieEnergy());
                    plot(DD_DEBUGGING1, tofBarAve * plotMult_ + plotOffset_,
                         start.GetPixieEnergy());
                }
            }

        }//loop over starts
    }//loop over bars
    EndProcess();
    return (true);
}