ATLAS Offline Software
VP1RawDataCollBase.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 // //
8 // Implementation of class VP1RawDataCollBase //
9 // //
10 // Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11 // Initial version: January 2009 //
12 // //
14 
20 #include "VP1Base/IVP13DSystem.h"
21 #include "VP1Base/VP1Msg.h"
22 
25 
26 //____________________________________________________________________
28 public:
29  QString key;
30  bool commonCuts(VP1RawDataHandleBase*handle);
33  QList<VP1Interval> allowedPhi;
34  VP1RawDataFlags::InDetPartsFlags allowedInDetParts;
35  std::vector<VP1RawDataHandleBase*> handles;
36  int iupdategui = 0;
37 };
38 
39 
40 //____________________________________________________________________
42  : VP1StdCollection(common->system(),"RawDataColl_"+key), m_common(common), m_d(new Imp)
43 {
44  m_d->key = key;
45  m_d->sepHelper = 0;
46  m_d->iupdategui = 0;
47 }
48 
49 //____________________________________________________________________
51 {
52  VP1StdCollection::init();//Must be here
54  connect(this,SIGNAL(visibilityChanged(bool)),this,SLOT(collVisibilityChanged(bool)));
55 
56  connect(m_common->controller(),SIGNAL(cutAllowedEtaChanged(const VP1Interval&)),
57  this,SLOT(setAllowedEta(const VP1Interval&)));
59 
60  connect(m_common->controller(),SIGNAL(cutAllowedPhiChanged(const QList<VP1Interval>&)),
61  this,SLOT(setAllowedPhi(const QList<VP1Interval>&)));
63 
64  connect(m_common->controller(),SIGNAL(enabledInDetPartsChanged(VP1RawDataFlags::InDetPartsFlags)),
65  this,SLOT(setEnabledInDetParts(VP1RawDataFlags::InDetPartsFlags)));
67 }
68 
69 //____________________________________________________________________
71 {
72  if (!m_d->sepHelper)
74  return m_d->sepHelper;
75 }
76 
77 //____________________________________________________________________
79 {
81  for (;it!=itE;++it)
82  delete *it;
83  m_d->handles.clear();
84 
85  delete m_d->sepHelper;
86  delete m_d;
87 }
88 
89 //____________________________________________________________________
91 {
92  return m_d->key;
93 }
94 
95 //____________________________________________________________________
97 {
98  if (VP1Msg::verbose())
99  messageVerbose("TrackCollHandleBase::collVisibilityChanged => "+str(vis));
100  if (vis)
101  recheckCutStatusOfAllNotVisibleHandles();//Fixme -> ofallhandles? All must be not visible anyway...
102  else
104 }
105 
106 //____________________________________________________________________
108 {
109  if (m_d->allowedEta==e)
110  return;
111  bool relaxed(e.contains(m_d->allowedEta));
112  bool tightened(m_d->allowedEta.contains(e));
113  m_d->allowedEta=e;
114  if (relaxed)
116  else if (tightened)
118  else
120 }
121 
122 //____________________________________________________________________
123 void VP1RawDataCollBase::setAllowedPhi(const QList<VP1Interval>&l)
124 {
125  if (m_d->allowedPhi==l)
126  return;
127  m_d->allowedPhi=l;
129 }
130 
131 //____________________________________________________________________
132 void VP1RawDataCollBase::setEnabledInDetParts(VP1RawDataFlags::InDetPartsFlags f)
133 {
134  if (!usesInDetPartsCuts())
135  return;
136  if (m_d->allowedInDetParts==f)
137  return;
138  bool relaxed((m_d->allowedInDetParts&f) == m_d->allowedInDetParts);
139  bool tightened((m_d->allowedInDetParts&f) == f);
141  if (relaxed)
143  else if (tightened)
145  else
147 }
148 
149 //____________________________________________________________________
151 {
152  if (handle)
153  m_d->handles.push_back(handle);
154  if (!((m_d->iupdategui)++)%200)
155  systemBase()->updateGUI();
156 }
157 
158 //____________________________________________________________________
160 {
162  if (!(handle->inInDetParts()&allowedInDetParts))
163  return false;
164 
165  bool allPhiAllowed = allowedPhi.count()==1&&allowedPhi.at(0).isAllR();
166  bool allEtaAllowed = allowedEta.isAllR();
167  if (allEtaAllowed&&allPhiAllowed)
168  return true;
169  if (allowedPhi.isEmpty()||allowedEta.isEmpty())
170  return false;
171  Amg::Vector3D p = handle->center();
172  if (!allEtaAllowed) {
173  if (!allowedEta.contains(p.eta()))
174  return false;
175  }
176  if (!allPhiAllowed) {
177  double phi(p.phi());
178  for(const VP1Interval& i : allowedPhi) {
179  if (i.contains(phi)||i.contains(phi+2*M_PI)||i.contains(phi-2*M_PI))
180  return true;
181  }
182  return false;
183  }
184  return true;
185 }
186 
187 //____________________________________________________________________
189 {
190  handle->setVisible( visible() && cut(handle) && m_d->commonCuts(handle) );
191 }
192 
193 //____________________________________________________________________
195 {
196  if (!isLoaded())
197  return;
198  common()->system()->deselectAll();
201  int i(0);
202  for (;it!=itE;++it) {
204  if (!(i++%200))
205  systemBase()->updateGUI();//since called from ::actualLoad<..>(..)
206  }
207  largeChangesEnd();
208 }
209 
210 //____________________________________________________________________
212 {
213  if (!isLoaded())
214  return;
215  //This method is called when a cut is tightened - thus we better start by deselectAll to avoid weird highlighting issues.
216  common()->system()->deselectAll();
217 
220  for (;it!=itE;++it) {
221  if ((*it)->visible())
223  }
224  largeChangesEnd();
225 }
226 
227 //____________________________________________________________________
229 {
230  if (!isLoaded())
231  return;
234  for (;it!=itE;++it) {
235  if (!(*it)->visible())
237  }
238  largeChangesEnd();
239 }
240 
241 //____________________________________________________________________
242 std::vector<VP1RawDataHandleBase*>& VP1RawDataCollBase::getHandles()
243 {
244  return m_d->handles;
245 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
VP1RawDataSysController::cutAllowedPhi
QList< VP1Interval > cutAllowedPhi() const
Definition: VP1RawDataSysController.cxx:215
VP1RawDataCollBase::Imp::allowedEta
VP1Interval allowedEta
Definition: VP1RawDataCollBase.cxx:32
VP1RawDataCollBase::addHandle
void addHandle(VP1RawDataHandleBase *)
Definition: VP1RawDataCollBase.cxx:150
VP1RawDataCollBase::Imp::iupdategui
int iupdategui
Definition: VP1RawDataCollBase.cxx:36
VP1RawDataHandleBase
Definition: VP1RawDataHandleBase.h:34
VP1RawDataCollBase::Imp::handles
std::vector< VP1RawDataHandleBase * > handles
Definition: VP1RawDataCollBase.cxx:35
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
VP1ExtraSepLayerHelper.h
VP1RawDataCollBase::~VP1RawDataCollBase
virtual ~VP1RawDataCollBase()
Definition: VP1RawDataCollBase.cxx:78
VP1RawDataCollBase::VP1RawDataCollBase
VP1RawDataCollBase(VP1RawDataCommonData *, const QString &key)
Definition: VP1RawDataCollBase.cxx:41
VP1Msg.h
VP1HelperClassBase::messageVerbose
void messageVerbose(const QString &) const
Definition: VP1HelperClassBase.cxx:78
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
skel.it
it
Definition: skel.GENtoEVGEN.py:396
VP1RawDataCollBase::cut
virtual bool cut(VP1RawDataHandleBase *)=0
M_PI
#define M_PI
Definition: ActiveFraction.h:11
VP1RawDataSysController::cutAllowedEta
VP1Interval cutAllowedEta() const
Definition: VP1RawDataSysController.cxx:209
VP1StdCollection::init
virtual void init(VP1MaterialButtonBase *button=0)
Definition: VP1StdCollection.cxx:73
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
VP1StdCollection::largeChangesBegin
virtual void largeChangesBegin()
Definition: VP1StdCollection.cxx:228
VP1RawDataCollBase::recheckCutStatusOfAllNotVisibleHandles
void recheckCutStatusOfAllNotVisibleHandles()
Definition: VP1RawDataCollBase.cxx:228
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
TruthTest.itE
itE
Definition: TruthTest.py:25
VP1RawDataCollBase::provideText
QString provideText() const
Definition: VP1RawDataCollBase.cxx:90
GeoPrimitives.h
VP1RawDataHandleBase::inInDetParts
virtual VP1RawDataFlags::InDetPartsFlags inInDetParts() const
Definition: VP1RawDataHandleBase.h:51
VP1RawDataCollBase::recheckCutStatusOfAllVisibleHandles
void recheckCutStatusOfAllVisibleHandles()
Definition: VP1RawDataCollBase.cxx:211
VP1RawDataCollBase::recheckCutStatusOfAllHandles
void recheckCutStatusOfAllHandles()
Definition: VP1RawDataCollBase.cxx:194
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
VP1ExtraSepLayerHelper
Definition: VP1ExtraSepLayerHelper.h:22
VP1RawDataCollBase::getHandles
std::vector< VP1RawDataHandleBase * > & getHandles()
Definition: VP1RawDataCollBase.cxx:242
VP1RawDataFlags::None
@ None
Definition: VP1RawDataFlags.h:24
lumiFormat.i
int i
Definition: lumiFormat.py:85
VP1RawDataCollBase::recheckCutStatus
void recheckCutStatus(VP1RawDataHandleBase *)
Definition: VP1RawDataCollBase.cxx:188
VP1RawDataCollBase::Imp
Definition: VP1RawDataCollBase.cxx:27
VP1RawDataSysController.h
VP1RawDataCollBase::m_common
VP1RawDataCommonData * m_common
Definition: VP1RawDataCollBase.h:71
IVP13DSystem.h
VP1StdCollection::visibilityChanged
void visibilityChanged(bool)
hist_file_dump.f
f
Definition: hist_file_dump.py:135
VP1RawDataCollBase::m_d
Imp * m_d
Definition: VP1RawDataCollBase.h:72
VP1RawDataCollBase::Imp::sepHelper
VP1ExtraSepLayerHelper * sepHelper
Definition: VP1RawDataCollBase.cxx:31
VP1Interval::isEmpty
bool isEmpty() const
EventPrimitives.h
VP1RawDataCommonData.h
VP1HelperClassBase::systemBase
IVP1System * systemBase() const
Definition: VP1HelperClassBase.h:50
VP1Interval::contains
bool contains(const double &x) const
VP1RawDataHandleBase::setVisible
void setVisible(bool)
Definition: VP1RawDataHandleBase.cxx:68
VP1StdCollection::isLoaded
bool isLoaded() const
Definition: VP1StdCollection.cxx:148
VP1RawDataCollBase::usesInDetPartsCuts
virtual bool usesInDetPartsCuts()
Definition: VP1RawDataCollBase.h:42
VP1RawDataCommonData::controller
VP1RawDataSysController * controller()
Definition: VP1RawDataCommonData.h:40
VP1RawDataSysController::enabledInDetParts
VP1RawDataFlags::InDetPartsFlags enabledInDetParts() const
Definition: VP1RawDataSysController.cxx:239
VP1RawDataCollBase.h
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
VP1MaterialButtonBase
Definition: VP1MaterialButton.h:25
VP1StdCollection::largeChangesEnd
virtual void largeChangesEnd()
Definition: VP1StdCollection.cxx:239
VP1RawDataCollBase::Imp::allowedInDetParts
VP1RawDataFlags::InDetPartsFlags allowedInDetParts
Definition: VP1RawDataCollBase.cxx:34
VP1RawDataCollBase::setAllowedPhi
void setAllowedPhi(const QList< VP1Interval > &)
Definition: VP1RawDataCollBase.cxx:123
VP1RawDataCollBase::init
virtual void init(VP1MaterialButtonBase *mat=0)
Definition: VP1RawDataCollBase.cxx:50
VP1Interval
Definition: VP1Interval.h:23
IVP1System::updateGUI
void updateGUI()
Definition: IVP1System.cxx:262
VP1RawDataCollBase::setEnabledInDetParts
void setEnabledInDetParts(VP1RawDataFlags::InDetPartsFlags)
Definition: VP1RawDataCollBase.cxx:132
VP1Interval::isAllR
bool isAllR() const
VP1StdCollection::collSep
SoSeparator * collSep() const
All 3D objects from this coll.
Definition: VP1StdCollection.cxx:212
VP1RawDataHandleBase::center
virtual Amg::Vector3D center()
Definition: VP1RawDataHandleBase.cxx:166
VP1StdCollection::visible
bool visible() const
Definition: VP1StdCollection.cxx:142
VP1RawDataCollBase::sepHelper
VP1ExtraSepLayerHelper * sepHelper() const
Definition: VP1RawDataCollBase.cxx:70
VP1RawDataFlags::All
@ All
Definition: VP1RawDataFlags.h:31
VP1RawDataHandleBase.h
VP1RawDataCollBase::collVisibilityChanged
void collVisibilityChanged(bool)
Definition: VP1RawDataCollBase.cxx:96
VP1RawDataCommonData
Definition: VP1RawDataCommonData.h:31
VP1Msg::verbose
static bool verbose()
Definition: VP1Msg.h:31
VP1RawDataCollBase::Imp::commonCuts
bool commonCuts(VP1RawDataHandleBase *handle)
Definition: VP1RawDataCollBase.cxx:159
VP1StdCollection
Definition: VP1StdCollection.h:31
VP1RawDataCommonData::system
IVP13DSystem * system()
Definition: VP1RawDataCommonData.h:41
VP1RawDataCollBase::setAllowedEta
void setAllowedEta(const VP1Interval &)
Definition: VP1RawDataCollBase.cxx:107
VP1RawDataCollBase::Imp::allowedPhi
QList< VP1Interval > allowedPhi
Definition: VP1RawDataCollBase.cxx:33
IVP13DSystem::deselectAll
virtual void deselectAll(SoCooperativeSelection *exception_sel=0)
Definition: IVP13DSystem.cxx:331
common
Definition: common.py:1
VP1RawDataCollBase::common
VP1RawDataCommonData * common() const
Definition: VP1RawDataCollBase.h:39
VP1RawDataCollBase::Imp::key
QString key
Definition: VP1RawDataCollBase.cxx:29
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37