31 throw cms::Exception(
"TypeMismatch") <<
"Argument is not an AlignableMuon";
70 double scale_ = 0, scaleError_ = 0, phiX_ = 0, phiY_ = 0, phiZ_ = 0;
71 double dX_ = 0, dY_ = 0, dZ_ = 0;
72 std::string distribution_;
73 std::ostringstream
error;
76 for ( std::vector<std::string>::iterator iParam = parameterNames.begin(); iParam != parameterNames.end(); iParam++ ) {
77 if ( (*iParam) ==
"scale" ) scale_ = Parameters.
getParameter<
double>( *iParam );
78 else if ( (*iParam) ==
"distribution" ) distribution_ = Parameters.
getParameter<std::string>( *iParam );
79 else if ( (*iParam) ==
"scaleError" ) scaleError_ = Parameters.
getParameter<
double>( *iParam );
80 else if ( (*iParam) ==
"phiX" ) phiX_ = Parameters.
getParameter<
double>( *iParam );
81 else if ( (*iParam) ==
"phiY" ) phiY_ = Parameters.
getParameter<
double>( *iParam );
82 else if ( (*iParam) ==
"phiZ" ) phiZ_ = Parameters.
getParameter<
double>( *iParam );
83 else if ( (*iParam) ==
"dX" ) dX_ = Parameters.
getParameter<
double>( *iParam );
84 else if ( (*iParam) ==
"dY" ) dY_ = Parameters.
getParameter<
double>( *iParam );
85 else if ( (*iParam) ==
"dZ" ) dZ_ = Parameters.
getParameter<
double>( *iParam );
88 if ( !error.str().length() ) error <<
"Unknown parameter name(s): ";
89 error <<
" " << *iParam;
93 param.push_back(scale_); param.push_back(scaleError_);
94 param.push_back(phiX_); param.push_back(phiY_);
95 param.push_back(phiZ_); param.push_back(dX_);
96 param.push_back(dY_); param.push_back(dZ_);
97 if( distribution_ ==
"gaussian" )
99 else if ( distribution_ ==
"flat" )
101 else if ( distribution_ ==
"fix" )
113 double scale_ = param[0];
double scaleError_ = param[1];
114 double phiX_ = param[2];
double phiY_ = param[3];
double phiZ_ = param[4];
115 double dX_ = param[5];
double dY_ = param[6];
double dZ_ = param[7];
116 double dist_ = param[8];
118 double dx = scale_*dX_;
double dy = scale_*dY_;
double dz = scale_*dZ_;
119 double phix = scale_*phiX_;
double phiy = scale_*phiY_;
double phiz = scale_*phiZ_;
120 double errorx = scaleError_*dX_;
double errory = scaleError_*dY_;
double errorz = scaleError_*dZ_;
121 double errorphix = scaleError_*phiX_;
double errorphiy = scaleError_*phiY_;
double errorphiz = scaleError_*phiZ_;
123 errorDisp.push_back(errorx); errorDisp.push_back(errory); errorDisp.push_back(errorz);
125 errorRotation.push_back(errorphix); errorRotation.push_back(errorphiy); errorRotation.push_back(errorphiz);
130 for(std::vector<Alignable *>::iterator iter = DTchambers.begin(); iter != DTchambers.end(); ++iter) {
132 index[myId.wheel()+2][myId.station()-1][myId.sector()-1] = counter;
135 for(
int wheel = 0; wheel < 5; wheel++) {
136 for(
int sector = 0; sector < 12; sector++) {
142 disp.push_back(disp_[0]); disp.push_back(disp_[1]); disp.push_back(disp_[2]);
143 rotation.push_back(rotation_[0]); rotation.push_back(rotation_[1]); rotation.push_back(rotation_[2]);
144 }
else if (dist_ == 1) {
147 disp.push_back(disp_[0]); disp.push_back(disp_[1]); disp.push_back(disp_[2]);
148 rotation.push_back(rotation_[0]); rotation.push_back(rotation_[1]); rotation.push_back(rotation_[2]);
150 disp.push_back(dx); disp.push_back(dy); disp.push_back(dz);
151 rotation.push_back(phix); rotation.push_back(phiy); rotation.push_back(phiz);
156 if(sector == 3 &&
station == 3) {
159 }
else if(sector == 9 &&
station == 3) {
175 double scale_ = param[0];
double scaleError_ = param[1];
176 double phiX_ = param[2];
double phiY_ = param[3];
double phiZ_ = param[4];
177 double dX_ = param[5];
double dY_ = param[6];
double dZ_ = param[7];
178 double dist_ = param[8];
180 double dx = scale_*dX_;
double dy = scale_*dY_;
double dz = scale_*dZ_;
181 double phix = scale_*phiX_;
double phiy = scale_*phiY_;
double phiz = scale_*phiZ_;
182 double errorx = scaleError_*dX_;
double errory = scaleError_*dY_;
double errorz = scaleError_*dZ_;
183 double errorphix = scaleError_*phiX_;
double errorphiy = scaleError_*phiY_;
double errorphiz = scaleError_*phiZ_;
185 errorDisp.push_back(errorx); errorDisp.push_back(errory); errorDisp.push_back(errorz);
187 errorRotation.push_back(errorphix); errorRotation.push_back(errorphiy); errorRotation.push_back(errorphiz);
189 int index[2][4][4][36];
190 int sector_index[2][4][4][36];
193 for(std::vector<Alignable *>::iterator iter = CSCchambers.begin(); iter != CSCchambers.end(); ++iter) {
194 CSCDetId myId((*iter)->geomDetId().rawId());
195 index[myId.endcap()-1][myId.station()-1][myId.ring()-1][myId.chamber()-1] = counter;
201 for(
int sector = 1; sector < 7; sector++) {
207 disp.push_back(disp_[0]); disp.push_back(disp_[1]); disp.push_back(disp_[2]);
208 rotation.push_back(rotation_[0]); rotation.push_back(rotation_[1]); rotation.push_back(rotation_[2]);
209 }
else if (dist_ == 1) {
212 disp.push_back(disp_[0]); disp.push_back(disp_[1]); disp.push_back(disp_[2]);
213 rotation.push_back(rotation_[0]); rotation.push_back(rotation_[1]); rotation.push_back(rotation_[2]);
215 disp.push_back(dx); disp.push_back(dy); disp.push_back(dz);
216 rotation.push_back(phix); rotation.push_back(phiy); rotation.push_back(phiz);
223 r_ring[0] = 0; r_ring[1] = 3;
225 r_ring[0] = 1; r_ring[1] = 2;
227 for(
int r_counter = 0; r_counter < 2; r_counter++) {
228 for(
int chamber = 0; chamber < 36; chamber++) {
229 if(sector == (sector_index[
endcap][
station][r_ring[r_counter]][chamber]+1)/2) {
238 for(
int chamber = 0; chamber < 36; chamber++) {
239 if(
ring == 0 && chamber > 17)
continue;
260 double scale_ = param[0];
double scaleError_ = param[1];
261 double phiX_ = param[2];
double phiY_ = param[3];
double phiZ_ = param[4];
262 double dX_ = param[5];
double dY_ = param[6];
double dZ_ = param[7];
263 double dist_ = param[8];
264 double dx = scale_*dX_;
double dy = scale_*dY_;
double dz = scale_*dZ_;
265 double phix = scale_*phiX_;
double phiy = scale_*phiY_;
double phiz = scale_*phiZ_;
266 double errorx = scaleError_*dX_;
double errory = scaleError_*dY_;
double errorz = scaleError_*dZ_;
267 double errorphix = scaleError_*phiX_;
double errorphiy = scaleError_*phiY_;
double errorphiz = scaleError_*phiZ_;
274 disp.push_back(disp_[0]); disp.push_back(disp_[1]); disp.push_back(disp_[2]);
275 rotation.push_back(rotation_[0]); rotation.push_back(rotation_[1]); rotation.push_back(rotation_[2]);
276 }
else if (dist_ == 1) {
279 disp.push_back(disp_[0]); disp.push_back(disp_[1]); disp.push_back(disp_[2]);
280 rotation.push_back(rotation_[0]); rotation.push_back(rotation_[1]); rotation.push_back(rotation_[2]);
282 disp.push_back(dx); disp.push_back(dy); disp.push_back(dz);
283 rotation.push_back(phix); rotation.push_back(phiy); rotation.push_back(phiz);
285 for(std::vector<Alignable *>::iterator iter = DTbarrel.begin(); iter != DTbarrel.end(); ++iter) {
291 for(std::vector<Alignable *>::iterator iter = CSCendcaps.begin(); iter != CSCendcaps.end(); ++iter) {
309 disp[0] += dispRot.
x(); disp[1] += dispRot.y(); disp[2] += dispRot.z();
T getParameter(std::string const &) const
Entry const & retrieve(char const *) const
edm::ParameterSet theScenario
Misalignment scenario to apply (from config file)
AlignableModifier theMuonModifier
void setSeed(long seed)
Resets the generator seed according to the argument.
align::Alignables CSCChambers()
void moveCSCSectors(const edm::ParameterSet &scenario)
this special method allows to move a CSCsector by a same amount
void addAlignmentPositionError(Alignable *alignable, float dx, float dy, float dz)
Add the AlignmentPositionError (in global frame) to Alignable.
AlignableMuon * theAlignableMuon
Pointer to alignable Muon object.
align::Alignables DTBarrel()
const std::vector< float > gaussianRandomVector(float sigmaX, float sigmaY, float sigmaZ) const
Return a vector of random numbers (gaussian distribution)
void moveChamberInSector(Alignable *, align::Scalars, align::Scalars, align::Scalars, align::Scalars)
void moveMuon(const edm::ParameterSet &scenario)
this special method allows to move the complete muon system by a same amount
void moveAlignable(Alignable *alignable, bool random, bool gaussian, float sigmaX, float sigmaY, float sigmaZ)
Move alignable in global space according to parameters.
align::Scalars extractParameters(const edm::ParameterSet &, const char *)
align::Alignables CSCEndcaps()
vector< ParameterSet > Parameters
static int sectorFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station)
align::Alignables DTChambers()
std::vector< Scalar > Scalars
MuonScenarioBuilder(Alignable *alignable)
Constructor.
std::vector< std::string > getParameterNames() const
const std::vector< float > flatRandomVector(float sigmaX, float sigmaY, float sigmaZ) const
Return a vector of random numbers (flat distribution)
void decodeMovements_(const edm::ParameterSet &pSet, const std::vector< Alignable * > &alignables)
Decode movements defined in given parameter set for given set of alignables.
void moveDTSectors(const edm::ParameterSet &scenario)
This special method allows to move a DTsector by a same amount.
void rotateAlignable(Alignable *alignable, bool random, bool gaussian, float sigmaPhiX, float sigmaPhiY, float sigmaPhiZ)
Rotate alignable in global space according to parameters.
AlignableModifier theModifier
Helper class for random movements.
static int triggerSectorFromLabels(int station, int ring, int chamber)
void addAlignmentPositionErrorFromRotation(Alignable *alignable, float phiX, float phiY, float phiZ)
Add alignment position error resulting from rotation in global frame.
static int triggerSubSectorFromLabels(int station, int chamber)
const PositionType & globalPosition() const
Return the global position of the object.
int theModifierCounter
Counter for applied modification.
Constructor of the full muon geometry.
bool hasParameter_(const std::string &name, const edm::ParameterSet &pSet) const
Check if given parameter exists in parameter set.
const BasicVectorType & basicVector() const
void applyScenario(const edm::ParameterSet &scenario)
Apply misalignment scenario to the Muon.
edm::ParameterSet getParameterSet_(const std::string &name, const edm::ParameterSet &pSet) const