#include #include #include #include #include #include namespace RAT { FECD::FECD() { fRawTriggerTime = 0.; // FECD is crate 17, card 15 fCrate = 17; fCard = 15; } FECD::~FECD() { } void FECD::BeginOfRun() { DBLinkPtr fLdaq = DB::Get()->GetLink("DAQ"); fFECDDelay = fLdaq->GetD("fecddelay"); fChannel = fLdaq->GetI("fecdchannel"); } void FECD::SetRawTrigTime(double rawTrigTime) { fRawTriggerTime = rawTrigTime + fFECDDelay; } // Send the raw trigger to a fecd channel, to store the unlatched time void FECD::SendRawTrig(DS::MC& mc) { int ipmt = 512*fCrate + 32*fCard + fChannel; // The EventBuilder loops over MCHit objects, and MCSamples for each // Create a new MCHit DS::MCHit mchit; mchit.SetID(ipmt); // The ratTrig comes from the MTCD, so skips the discriminator etc mchit.SetTime(fRawTriggerTime); mchit.SetQHS(0.0); mchit.SetQHL(0.0); mchit.SetQLX(0.0); mc.GetUnbuiltMCHits().AddFECDPMT( mchit ); } } // namespace RAT