Esempio n. 1
0
bool IS600GeProcessor::Process(RawEvent &event) {
    using namespace dammIds::ge;

    if (!EventProcessor::Process(event))
        return false;

    // Call base class processing
    GeProcessor::Process(event);

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

    for (vector<ChanEvent*>::iterator it1 = geEvents_.begin(); 
	 it1 != geEvents_.end(); ++it1) {
        ChanEvent *chan = *it1;
        
        double gEnergy = chan->GetCalEnergy();
        double gTime   = chan->GetCorrectedTime();
        //double decayTime = (gTime - cycleTime) * clockInSeconds;
        if (gEnergy < gammaThreshold_)
            continue;

        plot(neutron::D_ENERGY, gEnergy);
	if(hasBeta)
	  plot(neutron::betaGated::D_ENERGY, gEnergy);

	// granploty(neutron::DD_ENERGY__TIMEX,
        //             gEnergy, decayTime, timeResolution);
     // iteration over events


	plot(neutron::betaGated::DD_PROTONGAMMATDIFF_VS_GAMMAEN, gEnergy ,(gTime - lastProtonTime) / plotResolution) ;
    }
    EndProcess(); 
    return true;
}
Esempio n. 2
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);
}