13 , {
"lowMultiplicity",
false}
14 , {
"highMultiplicity",
false}
17 namespace HFTriggerRequirement
30 , m_useOneTrackTrigger(
false)
31 , m_useTwoTrackTrigger(
false)
32 , m_useLowMultiplicityTrigger(
false)
33 , m_useHighMultiplicityTrigger(
false)
39 , m_useOneTrackTrigger(
false)
40 , m_useTwoTrackTrigger(
false)
41 , m_useLowMultiplicityTrigger(
false)
42 , m_useHighMultiplicityTrigger(
false)
57 if (successfulTrigger) std::cout <<
"One of the heavy flavor triggers fired" << std::endl;
58 else std::cout <<
"No heavy flavor triggers fired" << std::endl;
61 int failedTriggerDecisions = 0;
64 if (
Verbosity() >=
VERBOSITY_SOME) std::cout <<
"The oneTrackTrigger did not fire for this event, skipping." << std::endl;
65 failedTriggerDecisions += 1;
69 if (
Verbosity() >=
VERBOSITY_SOME) std::cout <<
"The twoTrackTrigger did not fire for this event, skipping." << std::endl;
70 failedTriggerDecisions += 1;
74 if (
Verbosity() >=
VERBOSITY_SOME) std::cout <<
"The lowMultiplicityTrigger did not fire for this event, skipping." << std::endl;
75 failedTriggerDecisions += 1;
79 if (
Verbosity() >=
VERBOSITY_SOME) std::cout <<
"The highMultiplicityTrigger did not fire for this event, skipping." << std::endl;
80 failedTriggerDecisions += 1;
94 bool anyTriggerFired =
false;
110 const int numberOfFiredTriggers = std::accumulate(
begin(triggerDecisions),
end(triggerDecisions), 0,
111 [](
const int previous,
const std::pair<const std::string, bool>&
element)
112 {
return previous + element.second; });
114 if (numberOfFiredTriggers != 0) anyTriggerFired =
true;
116 return anyTriggerFired;
121 bool oneTrackTriggerDecision =
false;
123 for (
Track track : Tracks)
125 float pT = sqrt(pow(track(3,0), 2) + pow(track(4,0), 2));
126 float minIP = FLT_MAX;
135 return oneTrackTriggerDecision;
140 bool twoTrackTriggerDecision =
false;
141 std::vector<Track> goodTracks;
143 for (
Track track : Tracks)
145 std::vector<Track> singleTrack = {track};
147 if (oneTrackTriggerDecision) goodTracks.push_back(track);
150 if (goodTracks.size() > 1)
152 for (
unsigned int i = 0;
i < goodTracks.size();
i++)
154 for (
unsigned int j =
i + 1;
j < goodTracks.size();
j++)
162 return twoTrackTriggerDecision;
167 TrkrHitSetContainer* hitContainer = findNode::getClass<TrkrHitSetContainer>(topNode,
"TRKR_HITSET");
172 int inttHits[2] = {0};
174 for (
int i = 0;
i < 2;
i++)
177 hitsetitr != inttHitSetRange[
i].second;
181 inttHits[
i] += hitset->
size();
185 meanMultiplicity = (inttHits[0] + inttHits[1])/2;
186 asymmetryMultiplicity = (inttHits[0] - inttHits[1])/(inttHits[0] + inttHits[1]);
191 bool multiplicityTriggerDecision =
false;
195 if ( meanMultiplicity > meanRequirement && asymmetryMultiplicity < asymmRequirement)
196 multiplicityTriggerDecision =
true;
198 return multiplicityTriggerDecision;
203 bool multiplicityTriggerDecision =
false;
207 if ( meanMultiplicity < meanRequirement && asymmetryMultiplicity < asymmRequirement)
208 multiplicityTriggerDecision =
true;
210 return multiplicityTriggerDecision;
226 std::vector<Vertex> primaryVertices;
227 m_dst_vertexmap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMap");
232 primaryVertices.push_back(
makeVertex(topNode));
235 return primaryVertices;
254 std::vector<Track>
tracks;
255 m_dst_trackmap = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
268 for (
unsigned int i = 0;
i < 3;
i++)
270 trackPosition(
i,0) = track(
i,0);
271 trackMomentum(
i,0) = track(
i+3,0);
285 dcaVertex = pos - vertex - mom.dot(pos - vertex)*mom/(mom.dot(mom));
287 float twoD_DCA = std::sqrt(std::pow(dcaVertex(0,0), 2) + std::pow(dcaVertex(1,0), 2));
300 dcaVertex = pos - vertex - mom.dot(pos - vertex)*mom/(mom.dot(mom));
302 return std::abs(dcaVertex.norm());
316 Eigen::Vector3f momOneCrossmomTwo = momOne.cross(momTwo);
317 Eigen::Vector3f posOneMinusposTwo = posOne - posTwo;
318 dcaTrackSize = std::abs(momOneCrossmomTwo.dot(posOneMinusposTwo)/(momOneCrossmomTwo.norm()));
325 std::cout <<
"\n---------------HFTrigger information---------------" << std::endl;
326 if (
m_useOneTrackTrigger) std::cout <<
"The oneTrack trigger decision is " << triggerDecisions.find(
"oneTrack")->second << std::endl;
327 if (
m_useTwoTrackTrigger) std::cout <<
"The twoTrack trigger decision is " << triggerDecisions.find(
"twoTrack")->second << std::endl;
328 if (
m_useLowMultiplicityTrigger) std::cout <<
"The lowMultiplicity trigger decision is " << triggerDecisions.find(
"lowMultiplicity")->second << std::endl;
329 if (
m_useHighMultiplicityTrigger) std::cout <<
"The highMultiplicity trigger decision is " << triggerDecisions.find(
"highMultiplicity")->second << std::endl;
330 std::cout <<
"---------------------------------------------------\n" << std::endl;