ATLAS Offline Software
Loading...
Searching...
No Matches
TBBeamQualityDoubleHitsTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5//#####################################################
6//# #
7//# File : TBBeamQualityDoubleHitsTool.cxx #
8//# Package: TBRec #
9//# #
10//# Author : Marco Bieri <mbieri@sfu.ca> #
11//# #
12//# Last Modified: Feb 7/2005 #
13//#####################################################
14
15
17
20
21#include <string>
22#include <ios>
23#include <algorithm>
24
26 const std::string& name,
27 const IInterface* parent)
28 : TBBeamQualityTool(type,name,parent),
29 m_Scint1ADC(0),
31{
32
33 // enter cut parameters
34 // H6 default:
35 declareInterface<TBBeamQualityTool>(this);
36 declareProperty("Scintnames",m_scint_names);
37 declareProperty("ScintCut1",m_ScintCut1=1);
38 declareProperty("ScintCut2",m_ScintCut2=2);
39 declareProperty("ScintCut1ADC",m_ScintCut1ADC);
40 declareProperty("ScintCut2ADC",m_ScintCut2ADC);
41 declareProperty("h6cuts",m_h6cuts=true);
42}
43
46
47/*---------------INITIALIZE---------------*/
49{ //init
50 MsgStream log(msgSvc(),name());
51
52
53 return StatusCode::SUCCESS;
54}//init
55
56StatusCode TBBeamQualityDoubleHitsTool::accept(const std::vector<std::string>& particles)
57{//accept
58 MsgStream log(msgSvc(),name());
59
60 log << MSG::DEBUG
61 << "TBBeamQualityDoubleHits: Started Accept"
62 << endmsg;
63
64 if (m_h6cuts==true) {// h6cuts
65
66 // specifying correct cuts
67 // wide/narrow beam selection to be added
68
69 // Hadrons
70 if (particles[0]=="pi+" || particles[0]=="pi-" || particles[0]=="p+" ) {
71 m_ScintCut1ADC= 270;
72 m_ScintCut2ADC = 265;
73 }
74
75 // Leptons
76 if (particles[0]=="e+" || particles[0]=="e-" || particles[0]=="mu+" || particles[0]=="mu-" ) {
77 m_ScintCut1ADC= 280;
78 m_ScintCut2ADC = 275;
79 }
80
81 }// h6cuts
82
83 log <<MSG::DEBUG
84 << "m_ScintCut1ADC: "<< m_ScintCut1ADC
85 << "m_ScintCut2ADC: "<< m_ScintCut2ADC
86 <<endmsg;
87
88 TBScintillatorCont * scintCont = nullptr;
89 if (evtStore()->retrieve(scintCont, m_SGScintkey).isFailure()) {
90 log << MSG::DEBUG
91 << "Can't Retrieve "
93 <<" from SG"
94 << endmsg;
95 }
96 else {
97
98 m_Scint1ADC = 0;
99 m_Scint2ADC = 0;
100
101 for (const TBScintillator* scint : *scintCont) {
102 std::string detect = scint->getDetectorName();
103 if (detect==m_scint_names[m_ScintCut1]){
104 m_Scint1ADC = scint->getSignal();
105 }
106 if (detect==m_scint_names[m_ScintCut2]){
107 m_Scint2ADC = scint->getSignal();
108 }
109 }
110 }
111
113 return StatusCode::FAILURE;
114 }
115 else {
116 return StatusCode::SUCCESS;
117 }
118
119}//accept
#define endmsg
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
std::vector< std::string > m_scint_names
virtual StatusCode initializeTool() override
virtual StatusCode accept(const std::vector< std::string > &) override
TBBeamQualityDoubleHitsTool(const std::string &type, const std::string &name, const IInterface *parent)
TBBeamQualityTool(const std::string &name, const std::string &type, const IInterface *parent)
"TBEvent/TBScintillatorCont.h"