6 #include "CTPfragment/CTPfragment.h"
7 #include "CTPfragment/CTPdataformat.h"
26 return StatusCode::SUCCESS;
34 std::vector<int> ctpids_ele;
35 std::vector<int> ctpids_mu;
36 std::vector<int> ctpids_jets;
37 std::vector<int> ctpids;
41 ATH_MSG_DEBUG(
"L1CorrAlgInit: Configured to use item:" <<
item.name().c_str()<<
" CTPID:"<<
item.ctpId());
42 ctpids.push_back(
item.ctpId() );
44 ctpids_ele.push_back(
item.ctpId() );
47 ctpids_mu.push_back(
item.ctpId() );
50 ctpids_jets.push_back(
item.ctpId() );
61 for(
int n=0;
n<16 ;
n++){
70 for(
unsigned int n=0;
n<ctpids.size() ;
n++){
72 int cycle = ctpids[
n] / 32;
73 int pos = ctpids[
n] % 32;
78 tmpmask = tmpmask << (
pos);
85 for(
unsigned int n=0;
n<ctpids_ele.size() ;
n++){
87 int cycle = ctpids_ele[
n] / 32;
88 int pos = ctpids_ele[
n] % 32;
93 tmpmask = tmpmask << (
pos);
100 for(
unsigned int n=0;
n<ctpids_mu.size() ;
n++){
102 int cycle = ctpids_mu[
n] / 32;
103 int pos = ctpids_mu[
n] % 32;
108 tmpmask = tmpmask << (
pos);
115 for(
unsigned int n=0;
n<ctpids_jets.size() ;
n++){
117 int cycle = ctpids_jets[
n] / 32;
118 int pos = ctpids_jets[
n] % 32;
123 tmpmask = tmpmask << (
pos);
129 return StatusCode::SUCCESS;
138 ATH_CHECK(wh_trigComposite.
record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()));
139 auto trigCompCont = wh_trigComposite.
ptr();
147 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFragments;
148 std::vector<uint32_t> roblist;
150 roblist.push_back(0x770000);
154 std::ostringstream
os;
155 for(
auto rob : roblist){
159 <<
" ROBs requested/retrieved:" <<
os.str());
161 if (robFragments.size()<1){
163 return StatusCode::SUCCESS;
170 std::vector<uint32_t> tbp;
171 bool firedbc[3] = {0,0,0};
172 bool firedbc_ele[3] = {0,0,0};
173 bool firedbc_mu[3] = {0,0,0};
174 bool firedbc_jet[3] = {0,0,0};
186 for(
unsigned int bc=l1a-1; bc<l1a+2; bc++) {
187 tbp = CTPfragment::triggerDecisionBeforePrescales(rbf,bc);
188 unsigned ntbpwords(tbp.size());
189 for(
unsigned iw=0; iw<ntbpwords; iw++ ) {
194 firedbc[ibc] = firedbc[ibc] || (tmpand > 0);
195 firedbc_ele[ibc] = firedbc_ele[ibc] || (tmpand_ele > 0);
196 firedbc_mu[ibc] = firedbc_mu[ibc] || (tmpand_mu > 0);
197 firedbc_jet[ibc] = firedbc_jet[ibc] || (tmpand_jet > 0);
203 int beforeafterflag=0;
206 if ((firedbc[0] && firedbc[1]) || (firedbc[1] && firedbc[2])){
208 ATH_MSG_DEBUG(
"Event fired bc[0]: "<<firedbc[0]<<
", bc[1]: "<<firedbc[1]<<
", bc[2]: "<<firedbc[2]);
211 if(firedbc_ele[1]) l1a_type = 1;
212 if(firedbc_mu[1]) l1a_type = 2;
213 if(firedbc_jet[1]) l1a_type = 3;
214 if(firedbc_ele[1] && firedbc_mu[1]) l1a_type = 4;
215 if(firedbc_ele[1] && firedbc_jet[1]) l1a_type = 5;
216 if(firedbc_mu[1] && firedbc_jet[1]) l1a_type = 6;
217 if(firedbc_ele[1] && firedbc_mu[1] && firedbc_jet[1]) l1a_type = 7;
219 if((firedbc[0] && firedbc[1])){
220 beforeafterflag = -1;
222 if(firedbc_ele[0]) other_type = 1;
223 if(firedbc_mu[0]) other_type = 2;
224 if(firedbc_jet[0]) other_type = 3;
225 if(firedbc_ele[0] && firedbc_mu[0]) other_type = 4;
226 if(firedbc_ele[0] && firedbc_jet[0]) other_type = 5;
227 if(firedbc_mu[0] && firedbc_jet[0]) other_type = 6;
228 if(firedbc_ele[0] && firedbc_mu[0] && firedbc_jet[0]) other_type = 7;
231 else if((firedbc[1] && firedbc[2])){
233 if(firedbc_ele[2]) other_type = 1;
234 if(firedbc_mu[2]) other_type = 2;
235 if(firedbc_jet[2]) other_type = 3;
236 if(firedbc_ele[2] && firedbc_mu[2]) other_type = 4;
237 if(firedbc_ele[2] && firedbc_jet[2]) other_type = 5;
238 if(firedbc_mu[2] && firedbc_jet[2]) other_type = 6;
239 if(firedbc_ele[2] && firedbc_mu[2] && firedbc_jet[2]) other_type = 7;
242 if ((firedbc[0] && firedbc[1]) && (firedbc[1] && firedbc[2])){
248 trigCompCont->push_back(trigComp);
249 trigComp->setName(
"mistimemon_L1Dec");
250 trigCompL1A(*trigComp) = l1a_type;
251 trigCompOther(*trigComp) = other_type;
252 trigCompBeforeAfter(*trigComp) = beforeafterflag;
253 trigCompPass(*trigComp) = isPassed;
262 return StatusCode::SUCCESS;