17 return id.isBarrel() ? operator()(dynamic_cast<const PixelBarrelName&>(
id)) :
18 operator()(dynamic_cast<const PixelEndcapName&>(
id));
22 for (BarrelConnections::const_iterator ibc = theBarrel.begin(); ibc != theBarrel.end(); ibc++) {
23 for (vector<Bdu>::const_iterator ibd = (*ibc).second.begin(); ibd != (*ibc).second.end(); ibd++) {
24 if (ibd->b ==
id.shell() && ibd->l.inside(
id.layerName()) && ibd->z.inside(
id.
moduleName()) &&
25 ibd->f.inside(
id.ladderName()))
29 edm::LogError(
"** PixelToFEDAssociateFromAscii WARNING, name: ") <<
id.name() <<
" not associated to FED";
34 for (EndcapConnections::const_iterator iec = theEndcap.begin(); iec != theEndcap.end(); iec++) {
35 for (vector<Edu>::const_iterator ied = (*iec).second.begin(); ied != (*iec).second.end(); ied++) {
36 if (ied->e ==
id.halfCylinder() && ied->d.inside(
id.diskName()) && ied->b.inside(
id.bladeName()))
40 edm::LogError(
"** PixelToFEDAssociateFromAscii WARNING, name: ") <<
id.name() <<
" not associated to FED";
45 LogDebug(
"init, input file:") << cfg_name.c_str();
47 std::ifstream
file(cfg_name.c_str());
49 edm::LogError(
" ** PixelToFEDAssociateFromAscii,init ** ") <<
" cant open data file: " << cfg_name;
52 edm::LogInfo(
"PixelToFEDAssociateFromAscii, read data from: ") << cfg_name;
56 pair<int, vector<Bdu> > barCon;
57 pair<int, vector<Edu> > endCon;
65 if (
pos != string::npos)
77 if (
line.compare(0, 3,
"VER") == 0) {
88 else if (posF != string::npos) {
90 int id = atoi(
line.c_str());
99 else if (posB != string::npos) {
101 barCon.second.push_back(getBdu(
line));
107 else if (posE != string::npos) {
109 endCon.second.push_back(getEdu(
line));
112 send(barCon, endCon);
122 std::ostringstream
str;
123 str <<
" **PixelToFEDAssociateFromAscii ** BARREL FED CONNECTIONS: " << endl;
124 for (BarrelConnections::const_iterator ibc = theBarrel.begin(); ibc != theBarrel.end(); ibc++) {
125 str <<
"FED: " << ibc->first << endl;
126 for (vector<Bdu>::const_iterator ibd = (*ibc).second.begin(); ibd != (*ibc).second.end(); ibd++) {
127 str <<
"b: " << ibd->b <<
" l: " << ibd->l <<
" z: " << ibd->z <<
" f: " << ibd->f << endl;
130 str <<
" **PixelToFEDAssociateFromAscii ** ENDCAP FED CONNECTIONS: " << endl;
131 for (EndcapConnections::const_iterator iec = theEndcap.begin(); iec != theEndcap.end(); iec++) {
132 str <<
"FED: " << iec->first << endl;
133 for (vector<Edu>::const_iterator ied = (*iec).second.begin(); ied != (*iec).second.end(); ied++) {
134 str <<
" e: " << ied->e <<
" d: " << ied->d <<
" b: " << ied->b << endl;
141 if (!
b.second.empty())
142 theBarrel.push_back(
b);
143 if (!
e.second.empty())
144 theEndcap.push_back(
e);
156 if (
pos != string::npos)
161 if (
pos != string::npos)
166 if (
pos != string::npos)
180 if (
pos != string::npos)
185 if (
pos != string::npos)
196 const char*
line =
l.c_str();
199 int num = strtol(
line, &evp, 10);
202 s <<
"raad from line: ";
217 string s =
"** PixelToFEDAssociateFromAscii, read data, cant intrpret: ";
218 edm::LogInfo(
s) << endl <<
l << endl <<
"=====> send exception " << endl;
222 return Range(num1, num2);
PixelRecoRange< float > Range
Log< level::Error, false > LogError
PixelToFEDAssociateFromAscii(const std::string &fileName)
Edu getEdu(std::string) const
void init(const std::string &fileName)
initialisatin (read file)
Log< level::Info, false > LogInfo
void send(std::pair< int, std::vector< Bdu > > &, std::pair< int, std::vector< Edu > > &)
initialisation (read input file)
Bdu getBdu(std::string) const
int operator()(const PixelModuleName &) const override
FED id for module.
std::string version() const override
version
Range readRange(const std::string &) const