26 defineParameter(
"InputWidth1", 6);
27 defineParameter(
"InputWidth2", 6);
28 defineParameter(
"InputWidth3", 6);
29 defineParameter(
"InputWidth4", 1);
30 defineParameter(
"MaxTob1", 6);
31 defineParameter(
"MaxTob2", 4);
32 defineParameter(
"MaxTob3", 4);
33 defineParameter(
"MaxTob4", 1);
34 defineParameter(
"NumResultBits", 2);
37 defineParameter(
"ADVAEVersion", 1);
39 defineParameter(
"AnomalyScoreThresh", 3875, 0);
40 defineParameter(
"AnomalyScoreThresh", 3875, 1);
42 setNumberOutputBits(2);
50 p_NumberLeading1 = parameter(
"InputWidth1").value();
51 p_NumberLeading2 = parameter(
"InputWidth2").value();
52 p_NumberLeading3 = parameter(
"InputWidth3").value();
53 p_NumberLeading4 = parameter(
"InputWidth4").value();
55 if(parameter(
"MaxTob1").
value() > 0) p_NumberLeading1 = parameter(
"MaxTob1").value();
56 if(parameter(
"MaxTob2").
value() > 0) p_NumberLeading2 = parameter(
"MaxTob2").value();
57 if(parameter(
"MaxTob3").
value() > 0) p_NumberLeading3 = parameter(
"MaxTob3").value();
58 if(parameter(
"MaxTob4").
value() > 0) p_NumberLeading4 = parameter(
"MaxTob4").value();
60 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
61 p_AnomalyScoreThresh[
i] = parameter(
"AnomalyScoreThresh",
i).value();
67 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
68 std::string hname_accept =
"hAnomalyScore_accept_bit"+
std::to_string((
int)
i);
69 std::string hname_reject =
"hAnomalyScore_reject_bit"+
std::to_string((
int)
i);
71 bookHist(m_histAccept, hname_accept,
"ADScore", 500, 0, 5000);
72 bookHist(m_histReject, hname_reject,
"ADScore", 500, 0, 5000);
82 const std::vector<TCS::TOBArray *> &
output,
87 if(
input.size() == 4) {
98 std::vector<u_int> jet_pt(6,0), tau_pt(4,0),
mu_pt(4,0);
99 std::vector<int> jet_eta(6,0), tau_eta(4,0),
mu_eta(4,0);
102 for (u_int
i = 0;
i<(*jets).size() &&
i<6; ++
i) {
103 jet_pt[
i] = (*jets)[
i].Et();
104 jet_eta[
i] = (*jets)[
i].eta();
107 for (u_int
i = 0;
i < (*taus).size() &&
i<4; ++
i) {
108 tau_pt[
i] = (*taus)[
i].Et();
109 tau_eta[
i] = (*taus)[
i].eta();
110 tau_phi[
i] = (*taus)[
i].phi();
112 for (u_int
i = 0;
i < (*mus).size() &&
i<4; ++
i) {
137 std::vector<double> scoreVec(3,0);
139 TRG_MSG_DEBUG(
"The anomaly score is " << scoreVec[0] <<
", " << scoreVec[1] <<
", " << scoreVec[2] << std::endl);
140 parType_t score =
parType_t ( (scoreVec[0]*scoreVec[0] + scoreVec[1]*scoreVec[1] + scoreVec[2]*scoreVec[2])*1024 );
142 for(u_int
i=0;
i<numberOutputBits(); ++
i) {
144 if (
score > p_AnomalyScoreThresh[
i] ) {
147 for ( u_int j = 0; j<6 && j<(*jets).size(); ++j )
output[
i]->push_back((*
jets)[j]);
148 for ( u_int j = 0; j<4 && j<(*taus).size(); ++j )
output[
i]->push_back((*taus)[j]);
149 for ( u_int j = 0; j<4 && j<(*mus).size() ; ++j )
output[
i]->push_back((*mus) [j]);
153 if(fillHistos() and
accept) {
154 fillHist1D(m_histAccept[
i],
score);
155 }
else if(fillHistos() && !
accept) {
156 fillHist1D(m_histReject[
i],
score);
170 const std::vector<TCS::TOBArray *> &
output,
175 if(
input.size() == 4) {
186 std::vector<u_int> jet_pt(6,0), tau_pt(4,0),
mu_pt(4,0);
187 std::vector<int> jet_eta(6,0), tau_eta(4,0),
mu_eta(4,0);
190 for (u_int
i = 0;
i<(*jets).size() &&
i<6; ++
i) {
191 jet_pt[
i] = (*jets)[
i].Et();
192 jet_eta[
i] = (*jets)[
i].eta();
195 for (u_int
i = 0;
i < (*taus).size() &&
i<4; ++
i) {
196 tau_pt[
i] = (*taus)[
i].Et();
197 tau_eta[
i] = (*taus)[
i].eta();
198 tau_phi[
i] = (*taus)[
i].phi();
200 for (u_int
i = 0;
i < (*mus).size() &&
i<4; ++
i) {
224 std::vector<double> scoreVec(3,0);
226 TRG_MSG_DEBUG(
"The anomaly score is " << scoreVec[0] <<
", " << scoreVec[1] <<
", " << scoreVec[2] << std::endl);
227 parType_t score =
parType_t ( (scoreVec[0]*scoreVec[0] + scoreVec[1]*scoreVec[1] + scoreVec[2]*scoreVec[2])*1024 );
229 for(u_int
i=0;
i<numberOutputBits(); ++
i) {
231 if (
score > p_AnomalyScoreThresh[
i] ) {
234 for ( u_int j = 0; j<6 && j<(*jets).size(); ++j )
output[
i]->push_back((*
jets)[j]);
235 for ( u_int j = 0; j<4 && j<(*taus).size(); ++j )
output[
i]->push_back((*taus)[j]);
236 for ( u_int j = 0; j<4 && j<(*mus).size() ; ++j )
output[
i]->push_back((*mus) [j]);
240 if(fillHistos() and
accept) {
241 fillHist1D(m_histAccept[
i],
score);
242 }
else if(fillHistos() && !
accept) {
243 fillHist1D(m_histReject[
i],
score);