9 #include <alignment/dbobjects/VXDAlignment.h>
10 #include <alignment/GlobalLabel.h>
11 #include <alignment/PedeResult.h>
12 #include <cdc/dataobjects/WireID.h>
13 #include <cdc/dbobjects/CDCAlignment.h>
14 #include <vxd/dataobjects/VxdID.h>
16 #include <gtest/gtest.h>
23 using namespace alignment;
51 GlobalLabel::construct<VXDAlignment>(vxdSensor, paramid).registerTimeDependent(1, 100);
52 GlobalLabel::construct<CDCAlignment>(cdcWire, paramid).registerTimeDependent(1, 50);
53 GlobalLabel::construct<CDCAlignment>(cdcWire, paramid).registerTimeDependent(51, 100);
59 unsigned int& subrun = GlobalLabel::getCurrentTimeIntervalRef();
66 GlobalLabel::clearTimeDependentParamaters();
74 for (
int ilayer = 1; ilayer < 6; ilayer++) {
75 for (
unsigned int subrun = 0; subrun <= GlobalLabel::maxTID; subrun++) {
76 VxdID id(ilayer, 0, 0);
86 for (
int ilayer = 1; ilayer < 6; ilayer++) {
87 for (
unsigned int i = 0; i <= GlobalLabel::maxTID; i++) {
90 GlobalLabel movingLayerStaticParam = GlobalLabel::construct<VXDAlignment>(
VxdID(ilayer, 0, 0).
getID(), 4);
94 EXPECT_EQ(0, movingLayerStaticParam.
getTimeId());
104 GlobalLabel vxdlabel1 = GlobalLabel::construct<VXDAlignment>(vxdSensor, paramid);
105 GlobalLabel Cvxdlabel1 = GlobalLabel::construct<VXDAlignment>(vxdSensor, 2);
109 registerSomeTimeDepParams();
110 GlobalLabel vxdlabel2 = GlobalLabel::construct<VXDAlignment>(vxdSensor, paramid);
111 GlobalLabel Cvxdlabel2 = GlobalLabel::construct<VXDAlignment>(vxdSensor, 2);
116 GlobalLabel vxdlabel3 = GlobalLabel::construct<VXDAlignment>(vxdSensor, paramid);
117 GlobalLabel Cvxdlabel3 = GlobalLabel::construct<VXDAlignment>(vxdSensor, 2);
126 GlobalLabel vxdlabel1 = GlobalLabel::construct<VXDAlignment>(vxdSensor, paramid);
130 EXPECT_EQ(80, GlobalLabel::getCurrentTimeIntervalRef());
137 EXPECT_EQ(100873609, (
int)vxdlabel1);
138 EXPECT_EQ(100873609, (
unsigned int)vxdlabel1);
141 EXPECT_EQ(80, GlobalLabel::getCurrentTimeIntervalRef());
149 EXPECT_EQ(100873609, (
int)vxdlabel2);
150 EXPECT_EQ(100873609, (
unsigned int)vxdlabel2);
153 GlobalLabel other = GlobalLabel::construct<CDCAlignment>(cdcWire, 2);
154 EXPECT_EQ(270620402, other.
label());
156 EXPECT_EQ(100873609, other.
label());
164 GlobalLabel vxdlabel = GlobalLabel::construct<VXDAlignment>(vxdSensor, paramid);
165 GlobalLabel cdclabel = GlobalLabel::construct<CDCAlignment>(cdcWire, paramid);
166 EXPECT_EQ(100873609, vxdlabel.
label());
167 EXPECT_EQ(270620409, cdclabel.
label());
177 registerSomeTimeDepParams();
184 vxdlabel = GlobalLabel::construct<VXDAlignment>(vxdSensor, paramid);
185 cdclabel = GlobalLabel::construct<CDCAlignment>(cdcWire, paramid);
202 vxdlabel = GlobalLabel::construct<VXDAlignment>(vxdSensor, paramid);
203 cdclabel = GlobalLabel::construct<CDCAlignment>(cdcWire, paramid);
209 vxdlabel = GlobalLabel::construct<VXDAlignment>(vxdSensor, paramid);
210 cdclabel = GlobalLabel::construct<CDCAlignment>(cdcWire, paramid);
215 vxdlabel = GlobalLabel::construct<VXDAlignment>(vxdSensor, paramid);
216 cdclabel = GlobalLabel::construct<CDCAlignment>(cdcWire, paramid);
221 vxdlabel = GlobalLabel::construct<VXDAlignment>(vxdSensor, paramid);
222 cdclabel = GlobalLabel::construct<CDCAlignment>(cdcWire, paramid);
227 vxdlabel = GlobalLabel::construct<VXDAlignment>(vxdSensor, paramid);
228 cdclabel = GlobalLabel::construct<CDCAlignment>(cdcWire, paramid);
233 vxdlabel = GlobalLabel::construct<VXDAlignment>(vxdSensor, paramid);
234 cdclabel = GlobalLabel::construct<CDCAlignment>(cdcWire, paramid);
239 GlobalLabel::clearTimeDependentParamaters();
241 vxdlabel = GlobalLabel::construct<VXDAlignment>(vxdSensor, paramid);
242 cdclabel = GlobalLabel::construct<CDCAlignment>(cdcWire, paramid);
short cdcWire
Testing cdc id.
int paramid
Testng parameter id.
short vxdSensor
Testing vxd id.
void registerSomeTimeDepParams()
Register some parameters as time dependent.
virtual void TearDown()
cleanup
void setTime(unsigned int timeid)
Set current time slice for time dependent params.
Class to convert to/from global labels for Millepede II to/from detector & parameter identificators.
int label()
Returns encoded Pede label.
gidTYPE setParameterId(gidTYPE paramId)
Usefull setter to quickly change only the parameter id and return back the encoded label (for use in ...
gidTYPE getParameterId() const
Get id of alignment/calibration parameter.
bool getTimeFlag() const
Is label time-dependent?
gidTYPE getElementId() const
Returns the element id (like VxdID for silicon sensors) to identify sets of parameters in DB objects.
void registerTimeDependent(gidTYPE start, gidTYPE end=maxTID)
Register this Detector element and parameter as time dependent with instance starting at "start" time...
gidTYPE getTimeId() const
Get time id.
Class to uniquely identify a any structure of the PXD and SVD.
baseType getID() const
Get the unique id.
Class to identify a wire inside the CDC.
unsigned short getEWire() const
Getter for encoded wire number.
TEST_F(GlobalLabelTest, QickTestNormalOperation)
Test the default way of using this.
int getID(const std::vector< double > &breaks, double t)
get id of the time point t
Abstract base class for different kinds of events.