21 theDoPedestalSubtraction( theConf.getUntrackedParameter<bool>(
"SubtractPedestals",
true ) ),
22 theUseMinuitAlgorithm( theConf.getUntrackedParameter<bool>(
"RunMinuitAlignmentTubeAlgorithm",
false ) ),
23 theApplyBeamKinkCorrections( theConf.getUntrackedParameter<bool>(
"ApplyBeamKinkCorrections",
true ) ),
24 peakFinderThreshold( theConf.getUntrackedParameter<double>(
"PeakFinderThreshold", 10. ) ),
25 enableJudgeZeroFilter( theConf.getUntrackedParameter<bool>(
"EnableJudgeZeroFilter",
true ) ),
26 judgeOverdriveThreshold( theConf.getUntrackedParameter<unsigned int>(
"JudgeOverdriveThreshold", 220 ) ),
27 updateFromInputGeometry( theConf.getUntrackedParameter<bool>(
"UpdateFromInputGeometry",
false ) ),
28 misalignedByRefGeometry( theConf.getUntrackedParameter<bool>(
"MisalignedByRefGeometry",
false ) ),
29 theStoreToDB ( theConf.getUntrackedParameter<bool>(
"SaveToDbase",
false ) ),
30 theDigiProducersList( theConf.getParameter<std::vector<edm::
ParameterSet> >(
"DigiProducersList" ) ),
31 theSaveHistograms( theConf.getUntrackedParameter<bool>(
"SaveHistograms",
false ) ),
32 theCompression( theConf.getUntrackedParameter<int>(
"ROOTFileCompression", 1 ) ),
33 theFileName( theConf.getUntrackedParameter<std::string>(
"ROOTFileName",
"test.root" ) ),
34 theMaskTecModules( theConf.getUntrackedParameter<std::vector<unsigned int> >(
"MaskTECModules" ) ),
35 theMaskAtModules( theConf.getUntrackedParameter<std::vector<unsigned int> >(
"MaskATModules" ) ),
36 theSetNominalStrips( theConf.getUntrackedParameter<bool>(
"ForceFitterToNominalStrips",
false ) ),
37 theLasConstants( theConf.getUntrackedParameter<std::vector<edm::
ParameterSet> >(
"LaserAlignmentConstants" ) ),
39 theAlignableTracker(),
40 theAlignRecordName(
"TrackerAlignmentRcd" ),
41 theErrorRecordName(
"TrackerAlignmentErrorRcd" ),
46 std::cout <<
"=============================================================="
47 <<
"\n=== LaserAlignment module configuration ==="
60 <<
"\n Number of TEC modules masked = " <<
theMaskTecModules.size() <<
" (s. below list if > 0)"
61 <<
"\n Number of AT modules masked = " <<
theMaskAtModules.size() <<
" (s. below list if > 0)"
62 <<
"\n Store to database = " << (
theStoreToDB?
"true":
"false")
63 <<
"\n ----------------------------------------------- ----------"
65 <<
"\n=============================================================" << std::endl;
70 std::cout <<
" ===============================================================================================\n" << std::flush;
71 std::cout <<
" The following " <<
theMaskTecModules.size() <<
" TEC modules have been masked out and will not be considered by the TEC algorithm:\n " << std::flush;
76 std::cout <<
" ===============================================================================================\n\n" << std::flush;
79 std::cout <<
" ===============================================================================================\n" << std::flush;
80 std::cout <<
" The following " <<
theMaskAtModules.size() <<
" AT modules have been masked out and will not be considered by the AT algorithm:\n " << std::flush;
85 std::cout <<
" ===============================================================================================\n\n" << std::flush;
91 std::string alias ( theConf.
getParameter<std::string>(
"@module_label") );
94 produces<TkLasBeamCollection, edm::InRun>(
"tkLaserBeams" ).setBranchAlias( alias +
"TkLasBeamCollection" );
140 throw cms::Exception(
" [LaserAlignment::beginJob]") <<
" ** ERROR: could not open file:"
141 <<
theFileName.c_str() <<
" for writing." << std::endl;
153 std::stringstream nameBuilder;
156 int det,
ring, beam, disk,
pos;
159 det = 0; ring = 0; beam = 0; disk = 0;
172 nameBuilder.str(
"" );
173 nameBuilder <<
"TEC";
174 if( det == 0 ) nameBuilder <<
"+";
else nameBuilder <<
"-";
175 nameBuilder <<
"_Ring";
176 if( ring == 0 ) nameBuilder <<
"4";
else nameBuilder <<
"6";
177 nameBuilder <<
"_Beam" << beam;
178 nameBuilder <<
"_Disk" << disk;
183 nameBuilder <<
"_Histo";
184 summedHistograms.
SetTECEntry( det, ring, beam, disk,
new TH1D( nameBuilder.str().c_str(), nameBuilder.str().c_str(), 512, 0, 512 ) );
192 det = 2; beam = 0; pos = 0;
205 nameBuilder.str(
"" );
206 if( det == 2 ) nameBuilder <<
"TIB";
else nameBuilder <<
"TOB";
207 nameBuilder <<
"_Beam" << beam;
208 nameBuilder <<
"_Zpos" <<
pos;
214 nameBuilder <<
"_Histo";
223 det = 0; beam = 0; disk = 0;
236 nameBuilder.str(
"" );
237 nameBuilder <<
"TEC(AT)";
238 if( det == 0 ) nameBuilder <<
"+";
else nameBuilder <<
"-";
239 nameBuilder <<
"_Beam" << beam;
240 nameBuilder <<
"_Disk" << disk;
245 nameBuilder <<
"_Histo";
299 LogDebug(
"LaserAlignment") <<
"==========================================================="
300 <<
"\n Private analysis of event #"<< theEvent.
id().
event()
301 <<
" in run #" << theEvent.
id().
run();
308 int det,
ring, beam, disk,
pos;
319 for( det = 0; det < 2; ++det ) {
320 for( beam = 0; beam < 8; ++ beam ) {
321 for( disk = 0; disk < 9; ++disk ) {
333 det = 2; beam = 0; pos = 0;
351 std::cout <<
" [LaserAlignment::produce] -- LaserAlignment::isTECBeam declares this event " << ( isTECMode ?
"" :
"NOT " ) <<
"a TEC event." << std::endl;
355 std::cout <<
" [LaserAlignment::produce] -- LaserAlignment::isATBeam declares this event " << ( isATMode ?
"" :
"NOT " ) <<
"an AT event." << std::endl;
368 det = 0; ring = 0; beam = 0; disk = 0;
401 det = 2; beam = 0; pos = 0;
417 det = 0; beam = 0; disk = 0;
464 std::cout <<
" [LaserAlignment::endRun] -- Total number of events processed: " <<
theEvents << std::endl;
470 int det,
ring, beam, disk,
pos;
481 std::pair<double,double> peakFinderResults;
498 det = 0; ring = 0; beam = 0; disk = 0;
506 if( !isGoodFit )
std::cout <<
" [LaserAlignment::endRun] ** WARNING: Fit failed for TEC det: "
507 << det <<
", ring: " << ring <<
", beam: " << beam <<
", disk: " << disk
524 measuredStripPositions.
GetTECEntry( det, ring, beam, disk ) = peakFinderResults;
526 const GlobalPoint& globalPoint = theStripDet->surface().toGlobal( theStripDet->specificTopology().localPosition( positionInStrips ) );
535 measuredStripPositions.
GetTECEntry( det, ring, beam, disk ) = std::pair<float,float>( 256., 1000. );
536 const GlobalPoint& globalPoint = theStripDet->surface().toGlobal( theStripDet->specificTopology().localPosition( 256. ) );
548 det = 2; beam = 0; pos = 0;
556 if( !isGoodFit )
std::cout <<
" [LaserAlignment::endJob] ** WARNING: Fit failed for TIB/TOB det: "
557 << det <<
", beam: " << beam <<
", pos: " << pos
572 measuredStripPositions.
GetTIBTOBEntry( det, beam, pos ) = peakFinderResults;
574 const GlobalPoint& globalPoint = theStripDet->surface().toGlobal( theStripDet->specificTopology().localPosition( positionInStrips ) );
592 det = 0; beam = 0; disk = 0;
599 if( !isGoodFit )
std::cout <<
" [LaserAlignment::endRun] ** WARNING: Fit failed for TEC2TEC det: "
600 << det <<
", beam: " << beam <<
", disk: " << disk
615 measuredStripPositions.
GetTEC2TECEntry( det, beam, disk ) = peakFinderResults;
617 const GlobalPoint& globalPoint = theStripDet->surface().toGlobal( theStripDet->specificTopology().localPosition( positionInStrips ) );
683 const unsigned int nIterations = 30;
698 endcapParameters.
Print();
705 geometryUpdater.
EndcapUpdate( endcapParameters, measuredCoordinates );
741 const unsigned int nIterations = 30;
762 alignmentTubeParameters.
Print();
785 for( det = 0; det < 2; ++det ) {
786 for( ring = 0; ring < 2; ++
ring ) {
787 for( beam = 0; beam < 8; ++beam ) {
790 TkLasBeam currentBeam( 100 * det + 10 * beam + ring );
793 const int firstDisk = det==0 ? 0 : 8;
794 const int lastDisk = det==0 ? 8 : 0;
797 for( disk = firstDisk; det==0 ? disk <= lastDisk : disk >= lastDisk; det==0 ? ++disk : --disk ) {
807 theStripDet->specificTopology().localPosition( measuredStripPositions.
GetTECEntry( det, ring, beam, disk ).first ),
808 theStripDet->specificTopology().localError( measuredStripPositions.
GetTECEntry( det, ring, beam, disk ).first, measuredStripPositions.
GetTECEntry( det, ring, beam, disk ).second ),
816 laserBeams->push_back( currentBeam );
827 for( beam = 0; beam < 8; ++beam ) {
830 TkLasBeam currentBeam( 100 * 2 + 10 * beam + 0 );
835 for( disk = 4; disk >= 0; --disk ) {
845 theStripDet->specificTopology().localPosition( measuredStripPositions.
GetTEC2TECEntry( det, beam, disk ).first ),
846 theStripDet->specificTopology().localError( measuredStripPositions.
GetTEC2TECEntry( det, beam, disk ).first, measuredStripPositions.
GetTEC2TECEntry( det, beam, disk ).second ),
856 for( det = 2; det < 4; ++det ) {
857 for( pos = 5; pos >= 0; --
pos ) {
867 theStripDet->specificTopology().localPosition( measuredStripPositions.
GetTIBTOBEntry( det, beam, pos ).first ),
868 theStripDet->specificTopology().localError( measuredStripPositions.
GetTIBTOBEntry( det, beam, pos ).first, measuredStripPositions.
GetTIBTOBEntry( det, beam, pos ).second ),
880 for( disk = 0; disk < 5; ++disk ) {
890 theStripDet->specificTopology().localPosition( measuredStripPositions.
GetTEC2TECEntry( det, beam, disk ).first ),
891 theStripDet->specificTopology().localError( measuredStripPositions.
GetTEC2TECEntry( det, beam, disk ).first, measuredStripPositions.
GetTEC2TECEntry( det, beam, disk ).second ),
902 laserBeams->push_back( currentBeam );
908 theRun.
put( laserBeams,
"tkLaserBeams" );
921 std::cout <<
" [LaserAlignment::endRun] -- Storing the calculated alignment parameters to the DataBase:" << std::endl;
926 throw cms::Exception(
"NotAvailable" ) <<
"PoolDBOutputService not available";
946 std::cout <<
" [LaserAlignment::endRun] -- Storing done." << std::endl;
976 bool isRawDigi =
false;
979 int det = 0,
ring = 0, beam = 0, disk = 0,
pos = 0;
984 std::string
digiProducer = itDigiProducersList->getParameter<std::string>(
"DigiProducer" );
985 std::string
digiLabel = itDigiProducersList->getParameter<std::string>(
"DigiLabel" );
986 std::string digiType = itDigiProducersList->getParameter<std::string>(
"DigiType" );
990 if( digiType ==
"Raw" ) {
991 theEvent.
getByLabel( digiProducer, digiLabel, theStripRawDigis );
994 else if( digiType ==
"Processed" ) {
995 theEvent.
getByLabel( digiProducer, digiLabel, theStripDigis );
999 throw cms::Exception(
" [LaserAlignment::fillDataProfiles]") <<
" ** ERROR: Invalid digi type: \"" << digiType <<
"\" specified in configuration." << std::endl;
1005 det = 0;
ring = 0; beam = 0; disk = 0;
1018 if( detSetIter == theStripRawDigis->end() ) {
1019 throw cms::Exception(
"[Laser Alignment::fillDataProfiles]" ) <<
" ** ERROR: No raw DetSet found for det: " << detRawId <<
"." << std::endl;
1027 for (; digiRangeIterator != detSetIter->data.
end(); ++digiRangeIterator ) {
1029 const int channel = distance( digiRangeStart, digiRangeIterator );
1031 else throw cms::Exception(
"[Laser Alignment::fillDataProfiles]" ) <<
" ** ERROR: raw digi channel: " << channel <<
" out of range for det: " << detRawId <<
"." << std::endl;
1042 if( detSetIter == theStripDigis->end() )
continue;
1047 for(; digiRangeIterator != detSetIter->data.
end(); ++digiRangeIterator ) {
1050 else throw cms::Exception(
"[Laser Alignment::fillDataProfiles]" ) <<
" ** ERROR: digi strip: " << digi.
strip() <<
" out of range for det: " << detRawId <<
"." << std::endl;
1063 det = 2; beam = 0;
pos = 0;
1076 if( detSetIter == theStripRawDigis->end() ) {
1077 throw cms::Exception(
"[Laser Alignment::fillDataProfiles]" ) <<
" ** ERROR: No raw DetSet found for det: " << detRawId <<
"." << std::endl;
1085 for (; digiRangeIterator != detSetIter->data.
end(); ++digiRangeIterator ) {
1087 const int channel = distance( digiRangeStart, digiRangeIterator );
1089 else throw cms::Exception(
"[Laser Alignment::fillDataProfiles]" ) <<
" ** ERROR: raw digi channel: " << channel <<
" out of range for det: " << detRawId <<
"." << std::endl;
1100 if( detSetIter == theStripDigis->end() )
continue;
1105 for(; digiRangeIterator != detSetIter->data.
end(); ++digiRangeIterator ) {
1108 else throw cms::Exception(
"[Laser Alignment::fillDataProfiles]" ) <<
" ** ERROR: digi strip: " << digi.
strip() <<
" out of range for det: " << detRawId <<
"." << std::endl;
1118 det = 0; beam = 0; disk = 0;
1131 if( detSetIter == theStripRawDigis->end() ) {
1132 throw cms::Exception(
"[Laser Alignment::fillDataProfiles]" ) <<
" ** ERROR: No raw DetSet found for det: " << detRawId <<
"." << std::endl;
1140 for (; digiRangeIterator != detSetIter->data.
end(); ++digiRangeIterator ) {
1142 const int channel = distance( digiRangeStart, digiRangeIterator );
1144 else throw cms::Exception(
"[Laser Alignment::fillDataProfiles]" ) <<
" ** ERROR: raw digi channel: " << channel <<
" out of range for det: " << detRawId <<
"." << std::endl;
1155 if( detSetIter == theStripDigis->end() )
continue;
1160 for(; digiRangeIterator != detSetIter->data.
end(); ++digiRangeIterator ) {
1163 else throw cms::Exception(
"[Laser Alignment::fillDataProfiles]" ) <<
" ** ERROR: digi strip: " << digi.
strip() <<
" out of range for det: " << detRawId <<
"." << std::endl;
1188 int det,
ring, beam, disk,
pos;
1191 det = 0; ring = 0; beam = 0; disk = 0;
1195 int thePedestal = int( pedestalsHandle->getPed(
strip, pedRange ) );
1196 if( thePedestal > 895 ) thePedestal -= 1024;
1203 det = 2; beam = 0; pos = 0;
1207 int thePedestal = int( pedestalsHandle->getPed(
strip, pedRange ) );
1208 if( thePedestal > 895 ) thePedestal -= 1024;
1215 det = 0; beam = 0; disk = 0;
1219 int thePedestal = int( pedestalsHandle->getPed(
strip, pedRange ) );
1220 if( thePedestal > 895 ) thePedestal -= 1024;
1238 int numberOfProfiles = 0;
1241 for(
int det = 0; det < 2; ++det ) {
1242 for(
int beam = 0; beam < 8; ++ beam ) {
1243 for(
int disk = 0; disk < 9; ++disk ) {
1249 LogDebug(
"[LaserAlignment::isTECBeam]" ) <<
" Found: " << numberOfProfiles <<
"hits." << std::endl;
1250 std::cout <<
" [LaserAlignment::isTECBeam] -- Found: " << numberOfProfiles <<
" hits." << std::endl;
1252 if( numberOfProfiles > 10 )
return(
true );
1269 int numberOfProfiles = 0;
1271 int det = 2;
int beam = 0;
int pos = 0;
1276 LogDebug(
"[LaserAlignment::isATBeam]" ) <<
" Found: " << numberOfProfiles <<
"hits." << std::endl;
1277 std::cout <<
" [LaserAlignment::isATBeam] -- Found: " << numberOfProfiles <<
" hits." << std::endl;
1279 if( numberOfProfiles > 10 )
return(
true );
1298 if( det < 2 || det > 3 || beam > 7 || pos > 5 ) {
1299 throw cms::Exception(
"[LaserAlignment::getTIBTOBNominalBeamOffset]" ) <<
" ERROR ** Called with nonexisting parameter set: det " << det <<
" beam " << beam <<
" pos " << pos <<
"." << std::endl;
1302 const double nominalOffsetsTIB[8] = { 0.00035, 2.10687, -2.10827, -0.00173446, 2.10072, -0.00135114, 2.10105, -2.10401 };
1307 const int orientationPattern[6] = { -1, 1, 1, -1, -1, 1 };
1308 const double nominalOffsetsTOB[8] = { 0.00217408, 1.58678, 117.733, 119.321, 120.906, 119.328, 117.743, 1.58947 };
1311 if( det == 2 )
return( -1. * nominalOffsetsTIB[beam] );
1314 if( beam == 0
or beam > 4 )
return( nominalOffsetsTOB[beam] * orientationPattern[pos] );
1315 else return( -1. * nominalOffsetsTOB[beam] * orientationPattern[pos] );
1333 if( det > 1 || beam > 7 || disk > 5 ) {
1334 throw cms::Exception(
"[LaserAlignment::getTEC2TECNominalBeamOffset]" ) <<
" ERROR ** Called with nonexisting parameter set: det " << det <<
" beam " << beam <<
" disk " << disk <<
"." << std::endl;
1337 const double nominalOffsets[8] = { 0., 2.220, -2.221, 0., 2.214, 0., 2.214, -2.217 };
1339 if( det == 0 )
return -1. * nominalOffsets[beam];
1340 else return nominalOffsets[beam];
1358 const double tecPhiPositions[8] = { 0.392699, 1.178097, 1.963495, 2.748894, 3.534292, 4.319690, 5.105088, 5.890486 };
1359 const double atPhiPositions[8] = { 0.392699, 1.289799, 1.851794, 2.748894, 3.645995, 4.319690, 5.216791, 5.778784 };
1362 const double tobRPosition = 600.;
1363 const double tibRPosition = 514.;
1364 const double tecRPosition[2] = { 564., 840. };
1367 const double tobZPosition[6] = { 1040., 580., 220., -140., -500., -860. };
1368 const double tibZPosition[6] = { 620., 380., 180., -100., -340., -540. };
1371 const double tecZPosition[9] = { 1322.5, 1462.5, 1602.5, 1742.5, 1882.5, 2057.5, 2247.5, 2452.5, 2667.5 };
1381 int det,
ring, beam, disk,
pos;
1385 det = 0; ring = 0, beam = 0; disk = 0;
1395 }
while( moduleLoop.
TECLoop( det, ring, beam, disk ) );
1400 det = 2; beam = 0; pos = 0;
1409 }
while( moduleLoop.
TIBTOBLoop( det, beam, pos ) );
1415 det = 0; beam = 0; disk = 0;
1425 }
while( moduleLoop.
TEC2TECLoop( det, beam, disk ) );
1440 if( angle < -1. * M_PI || angle >
M_PI ) {
1441 throw cms::Exception(
" [LaserAlignment::ConvertAngle] ") <<
"** ERROR: Called with illegal input angle: " << angle <<
"." << std::endl;
1444 if( angle >= 0. )
return angle;
1445 else return( angle + 2. * M_PI );
1459 int det,
ring, beam, disk,
pos;
1461 std:: cout << std::endl <<
" [LaserAlignment::DumpPosFileSet] -- Dump: " << std::endl;
1464 det = 0; ring = 0; beam = 0; disk = 0;
1467 }
while ( loop.
TECLoop( det, ring, beam, disk ) );
1470 det = 2; beam = 0; pos = 0;
1473 }
while( loop.
TIBTOBLoop( det, beam, pos ) );
1476 det = 0; beam = 0; disk = 0;
1481 std:: cout << std::endl <<
" [LaserAlignment::DumpPosFileSet] -- End dump: " << std::endl;
1495 int det,
ring, beam, disk,
pos;
1497 std:: cout << std::endl <<
" [LaserAlignment::DumpStripFileSet] -- Dump: " << std::endl;
1500 det = 0; ring = 0; beam = 0; disk = 0;
1502 std::cout <<
"STRIP " << det <<
"\t" << beam <<
"\t" << disk <<
"\t" << ring <<
"\t" << measuredStripPositions.GetTECEntry( det, ring, beam, disk ).first
1503 <<
"\t" << measuredStripPositions.GetTECEntry( det, ring, beam, disk ).second << std::endl;
1504 }
while ( loop.
TECLoop( det, ring, beam, disk ) );
1507 det = 2; beam = 0; pos = 0;
1509 std::cout <<
"STRIP " << det <<
"\t" << beam <<
"\t" << pos <<
"\t" <<
"-1" <<
"\t" << measuredStripPositions.GetTIBTOBEntry( det, beam, pos ).first
1510 <<
"\t" << measuredStripPositions.GetTIBTOBEntry( det, beam, pos ).second << std::endl;
1511 }
while( loop.
TIBTOBLoop( det, beam, pos ) );
1514 det = 0; beam = 0; disk = 0;
1516 std::cout <<
"STRIP " << det <<
"\t" << beam <<
"\t" << disk <<
"\t" <<
"-1" <<
"\t" << measuredStripPositions.GetTEC2TECEntry( det, beam, disk ).first
1517 <<
"\t" << measuredStripPositions.GetTEC2TECEntry( det, beam, disk ).second << std::endl;
1520 std:: cout << std::endl <<
" [LaserAlignment::DumpStripFileSet] -- End dump: " << std::endl;
1534 std::cout <<
" [LaserAlignment::DumpHitmaps] -- Dumping hitmap for TEC+:" << std::endl;
1535 std::cout <<
" [LaserAlignment::DumpHitmaps] -- Ring4:" << std::endl;
1536 std::cout <<
" disk0 disk1 disk2 disk3 disk4 disk5 disk6 disk7 disk8" << std::endl;
1538 for(
int beam = 0; beam < 8; ++beam ) {
1540 for(
int disk = 0; disk < 9; ++disk ) {
1546 std::cout <<
" [LaserAlignment::DumpHitmaps] -- Ring6:" << std::endl;
1547 std::cout <<
" disk0 disk1 disk2 disk3 disk4 disk5 disk6 disk7 disk8" << std::endl;
1549 for(
int beam = 0; beam < 8; ++beam ) {
1551 for(
int disk = 0; disk < 9; ++disk ) {
1557 std::cout <<
" [LaserAlignment::DumpHitmaps] -- Dumping hitmap for TEC-:" << std::endl;
1558 std::cout <<
" [LaserAlignment::DumpHitmaps] -- Ring4:" << std::endl;
1559 std::cout <<
" disk0 disk1 disk2 disk3 disk4 disk5 disk6 disk7 disk8" << std::endl;
1561 for(
int beam = 0; beam < 8; ++beam ) {
1563 for(
int disk = 0; disk < 9; ++disk ) {
1569 std::cout <<
" [LaserAlignment::DumpHitmaps] -- Ring6:" << std::endl;
1570 std::cout <<
" disk0 disk1 disk2 disk3 disk4 disk5 disk6 disk7 disk8" << std::endl;
1572 for(
int beam = 0; beam < 8; ++beam ) {
1574 for(
int disk = 0; disk < 9; ++disk ) {
1580 std::cout <<
" [LaserAlignment::DumpHitmaps] -- End of dump." << std::endl << std::endl;
1599 int det,
ring, beam, disk;
1605 det = 0; ring = 0; beam = 0; disk = 0;
1612 const double nominalPhi = nominalCoordinates.
GetTECEntry( det, ring, beam, disk ).
GetPhi();
1618 measuredCoordinates.
GetTECEntry( det, ring, beam, disk ).
SetPhi( nominalPhi - phiCorrection );
1622 }
while ( moduleLoop.
TECLoop( det, ring, beam, disk ) );
1643 int det, beam, disk,
pos;
1652 det = 2; beam = 0; pos = 0;
1669 }
while ( moduleLoop.
TIBTOBLoop( det, beam, pos ) );
1674 det = 0; beam = 0; disk = 0;
1691 }
while ( moduleLoop.
TEC2TECLoop( det, beam, disk ) );
1711 const double atPhiPositions[8] = { 0.392699, 1.289799, 1.851794, 2.748894, 3.645995, 4.319690, 5.216791, 5.778784 };
1712 const double tecPhiPositions[8] = { 0.392699, 1.178097, 1.963495, 2.748894, 3.534292, 4.319690, 5.105088, 5.890486 };
1713 const double zPositions[9] = { 125.0, 139.0, 153.0, 167.0, 181.0, 198.5, 217.5, 238.0, 259.5 };
1714 const double zPositionsTIB[6] = { 62.0, 38.0, 18.0, -10.0, -34.0, -54.0 };
1715 const double zPositionsTOB[6] = { 104.0, 58.0, 22.0, -14.0, -50.0, -86.0 };
1717 int det, beam, disk,
pos,
ring;
1720 det = 0; ring = 0; beam = 0; disk = 0;
1723 const double radius = ring?84.0:56.4;
1732 const LocalPoint lp( theStripDet->surface().toLocal( gp ) );
1733 std::cout <<
"__TEC: " << 256. - theStripDet->specificTopology().strip( lp ) << std::endl;
1740 det = 2; beam = 0; pos = 0;
1743 const double radius = (det==2?51.4:58.4);
1744 const double theZ = (det==2?zPositionsTIB[
pos]:zPositionsTOB[
pos]);
1753 const LocalPoint lp( theStripDet->surface().toLocal( gp ) );
1754 std::cout <<
"__TIBTOB det " << det <<
" beam " << beam <<
" pos " << pos <<
" " << 256. - theStripDet->specificTopology().strip( lp );
1755 std::cout <<
" " << theStripDet->position().perp()<< std::endl;
1762 det = 0; beam = 0; disk = 0;
1765 const double radius = 56.4;
1774 const LocalPoint lp( theStripDet->surface().toLocal( gp ) );
1775 std::cout <<
"__TEC2TEC det " << det <<
" beam " << beam <<
" disk " << disk <<
" " << 256. - theStripDet->specificTopology().strip( lp ) << std::endl;
bool IsSignalIn(const LASModuleProfile &, double)
void SetTEC2TECEntry(int subdetector, int beam, int tecDisk, T)
const uint16_t & adc() const
T getParameter(std::string const &) const
EventNumber_t event() const
unsigned int judgeOverdriveThreshold
config parameters for the LASProfileJudge
void fillDataProfiles(edm::Event const &, edm::EventSetup const &)
fill profiles from SiStrip(Raw)Digi container
bool theSaveHistograms
config switch
void SetPhiError(double aPhiError)
void ApplyEndcapMaskingCorrections(LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &, LASEndcapAlignmentParameterSet &)
apply endcap correction to masked modules in TEC
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void TrackerUpdate(LASEndcapAlignmentParameterSet &, LASBarrelAlignmentParameterSet &, AlignableTracker &)
void SetMisalignmentFromRefGeometry(bool)
bool misalignedByRefGeometry
config switch
std::string theAlignRecordName
#define DEFINE_FWK_MODULE(type)
bool isTECBeam(void)
decide whether TEC or AT beams have fired
LaserAlignment(edm::ParameterSet const &theConf)
virtual void endRun(edm::Run &, const edm::EventSetup &)
double getTIBTOBNominalBeamOffset(unsigned int, unsigned int, unsigned int)
returns the nominal beam position (strips) in TOB for the profileJudge
edm::ESHandle< TrackerGeometry > theTrackerGeometry
double peakFinderThreshold
config parameter
void DumpHitmaps(LASGlobalData< int > &)
for debugging only, will disappear
void DumpPosFileSet(LASGlobalData< LASCoordinateSet > &)
for debugging only, will disappear
LASGlobalData< int > numberOfAcceptedProfiles
void SetAllValuesTo(const double &)
std::pair< ContainerIterator, ContainerIterator > Range
bool theDoPedestalSubtraction
config switch
LASGlobalData< LASModuleProfile > currentDataProfiles
data profiles for the current event
std::vector< unsigned int > theMaskTecModules
config parameters
bool theUseMinuitAlgorithm
config switch
TFile * theFile
Tree stuff.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
LASGlobalData< int > isAcceptedProfile
std::vector< edm::ParameterSet > theDigiProducersList
void DumpStripFileSet(LASGlobalData< std::pair< float, float > > &)
for debugging only, will disappear
void fillPedestalProfiles(edm::ESHandle< SiStripPedestals > &)
fill pedestals from dbase
double GetPhi(void) const
Handle< TkLasBeamCollection > laserBeams
LASGlobalData< TH1D * > summedHistograms
bool FindPeakIn(const LASModuleProfile &, std::pair< double, double > &, TH1D *, const double)
TDirectory * singleModulesDir
void push_back(const SiStripLaserRecHit2D &aHit)
insert a hit in the data vector
double ConvertAngle(double)
convert an angle in the [-pi,pi] range to the [0,2*pi] range
LASBarrelAlignmentParameterSet CalculateParameters(LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &)
edm::ESHandle< Alignments > theGlobalPositionRcd
const uint16_t & strip() const
bool TEC2TECLoop(int &, int &, int &) const
std::string theFileName
config parameter (histograms file output name)
cond::Time_t beginOfTime() const
void get(HolderT &iHolder) const
AlignmentErrors * alignmentErrors() const
Return alignment errors, sorted by DetId.
std::vector< unsigned int > tecDoubleHitDetId
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
void SetAmplitudeThreshold(double)
bool theApplyBeamKinkCorrections
config switch
T & GetTIBTOBEntry(int subdetector, int beam, int tibTobPosition)
bool JudgeProfile(const LASModuleProfile &, double)
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
void SetReverseDirection(bool)
void SetTIBTOBEntry(int subdetector, int beam, int tibTobPosition, T)
virtual const GeomDet * idToDet(DetId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void CalculateNominalCoordinates(void)
fills a LASGlobalData<LASCoordinateSet> with nominal module positions
iterator end()
Return the off-the-end iterator.
LASEndcapAlignmentParameterSet CalculateParameters(LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &)
std::string theErrorRecordName
double GetTEC2TECAlignmentParameterCorrection(int, int, int, LASGlobalData< LASCoordinateSet > &, LASBarrelAlignmentParameterSet &)
virtual void endJob(void)
void SetValue(unsigned int theStripNumber, const double &theValue)
bool theStoreToDB
config switch
Detector identifier class for the strip tracker.
LASGlobalData< LASModuleProfile > pedestalProfiles
virtual void beginJob(void)
T & GetTEC2TECEntry(int subdetector, int beam, int tecDisk)
LASGlobalData< LASCoordinateSet > nominalCoordinates
AlignableTracker * theAlignableTracker
int theEvents
counter for the total number of events processed
LASBarrelAlignmentParameterSet CalculateParameters(LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &)
LASConstants theLasConstants
double getTEC2TECNominalBeamOffset(unsigned int, unsigned int, unsigned int)
returns the nominal beam position (strips) in TEC (AT) for the profileJudge
void SetOverdriveThreshold(unsigned int)
TrackerGeometry * build(const GeometricDet *gd)
T & GetTECEntry(int subdetector, int tecRing, int beam, int tecDisk)
LASGlobalData< std::string > theProfileNames
double GetAlignmentParameterCorrection(int, int, int, int, LASGlobalData< LASCoordinateSet > &, LASEndcapAlignmentParameterSet &)
std::vector< unsigned int > theMaskAtModules
void ApplyATMaskingCorrections(LASGlobalData< LASCoordinateSet > &, LASGlobalData< LASCoordinateSet > &, LASBarrelAlignmentParameterSet &)
same for alignment tube modules
void testRoutine(void)
for debugging & testing only, will disappear..
LASGlobalData< LASModuleProfile > collectedDataProfiles
void fillDetectorId(void)
fill hard coded detIds
void ApplyBeamKinkCorrections(LASGlobalData< LASCoordinateSet > &) const
int theCompression
config parameter (histograms file compression level)
void EnableZeroFilter(bool)
LASGlobalData< unsigned int > detectorId
bool TECLoop(int &, int &, int &, int &) const
virtual void produce(edm::Event &, edm::EventSetup const &)
bool TIBTOBLoop(int &, int &, int &) const
double GetPhiError(void) const
void put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< TkLasBeam > TkLasBeamCollection
iterator begin()
Return an iterator to the first DetSet.
bool enableJudgeZeroFilter
config switch
Alignments * alignments() const
Return alignments, sorted by DetId.
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
const uint16_t & adc() const
A Digi for the silicon strip detector, containing only adc information, and suitable for storing raw ...
double GetTIBTOBAlignmentParameterCorrection(int, int, int, LASGlobalData< LASCoordinateSet > &, LASBarrelAlignmentParameterSet &)
void SetTECEntry(int subdetector, int tecRing, int beam, int tecDisk, T)
edm::ESHandle< GeometricDet > gD
tracker geometry;
void EndcapUpdate(LASEndcapAlignmentParameterSet &, LASGlobalData< LASCoordinateSet > &)
bool updateFromInputGeometry
config switch
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
bool theSetNominalStrips
config switch