35 hist_file=
new TFile(histoFileName.c_str(),
"RECREATE");
43 std::ostringstream ss;
46 ss <<idint<<
"_Anode_First_Time";
47 mh_FirstTime[idint]=
new TH2F(ss.str().c_str(),
"",675,0.0,675.0,50,0.0,10.0);
48 mh_FirstTime[idint]->GetXaxis()->SetTitle(
"(Layer-1)*Nwires+Wire");
49 mh_FirstTime[idint]->GetYaxis()->SetTitle(
"Anode First Time Bin");
55 ss <<
"Layer_Nmb_Pulses";
63 ss <<idint<<
"_Anode_Wire_Eff";
64 mh_WireEff[idint]=
new TH1F(ss.str().c_str(),
"",675,0.0,675.0);
65 mh_WireEff[idint]->GetXaxis()->SetTitle(
"(Layer-1)*Nwires+Wire");
66 mh_WireEff[idint]->GetYaxis()->SetTitle(
"Efficiency");
71 ss <<idint<<
"_Anode_Eff";
72 mh_Eff[idint]=
new TH1F(ss.str().c_str(),
"",110,-0.05,1.05);
73 mh_Eff[idint]->GetXaxis()->SetTitle(
"Efficiency");
74 mh_Eff[idint]->GetYaxis()->SetTitle(
"Entries");
79 ss <<idint<<
"_Anode_Wire_Pair_Layer_Crosstalk";
87 ss <<idint<<
"_Anode_Pair_Layer_Crosstalk";
95 ss <<idint<<
"_Anode_Wire_NonPair_Layer_Crosstalk";
103 ss <<idint<<
"_Anode_NonPair_Layer_Crosstalk";
113 const int&
id,
float&
x,
float w) {
115 std::map<int,TH1*>::iterator
h;
121 h->second->Fill(x,w);
125 const int&
id,
float&
x,
float&
y,
float w) {
127 std::map<int,TH2*>::iterator
h;
133 h->second->Fill(x,y,w);
140 std::ostringstream ss;
141 std::map<int,std::vector<int> >::iterator viIt;
142 std::map<int, std::vector<std::vector<float> > >::iterator vvfIt;
160 if(wirecltn.begin() != wirecltn.end()) {
162 for (wiredetUnitIt=wirecltn.begin();
163 wiredetUnitIt!=wirecltn.end();
166 const CSCDetId&
id = (*wiredetUnitIt).first;
167 const int idchamber=
id.
endcap()*10000 +
id.station()*1000+
168 id.ring()*100 +
id.chamber();
169 const int idlayer =
id.endcap()*100000+
id.station()*10000+
170 id.ring()*1000+
id.chamber()*10+
id.layer();
173 std::vector<int> wireplane(maxwire,0);
177 range.first; digiIt!=range.second; ++digiIt){
179 int iwire=(*digiIt).getWireGroup();
181 if(wireplane[iwire-1]==0) {
182 wireplane[iwire-1]=(*digiIt).getBeamCrossingTag()+1;
185 x=(
id.layer()-1)*maxwire + iwire;
186 y=wireplane[iwire-1];
190 wireplane[iwire-1]=1;
203 const int idwirev=(*viIt).first;
204 const std::vector<int> wiretemp=(*viIt).second;
206 std::vector<float> zer(nsize,0);
209 for(
unsigned int j=0;
j<wiretemp.size();
j++)
213 for(
unsigned int i=0;
i<(*viIt).second.size();
i++) {
214 current_layer=(*viIt).first/10;
215 current_layer=(*viIt).first - current_layer*10;
218 vvfIt->second[
i][1]=vvfIt->second[
i][1]+
224 vvfIt->second[
i][2]=vvfIt->second[
i][2]+
228 vvfIt->second[
i][2]=vvfIt->second[
i][2]+
233 current_layer>2 && current_layer<5) ||
234 (pulsed_layer<5 && current_layer>4))
235 vvfIt->second[
i][3]=vvfIt->second[
i][3]+
251 std::map<int, int>::iterator intIt;
252 std::map<int, std::vector<std::vector<float> > >::iterator vvfIt;
256 std::cout<<
"Number of pulses per layer"<<std::endl;
273 int idlayer=(*vvfIt).first;
274 int idchmb=idlayer/10;
275 int layer=idlayer-idchmb*10;
276 for (
unsigned int i=0;
i<(*vvfIt).second.size();
i++) {
278 (*vvfIt).second[
i][3]=(*vvfIt).second[
i][3]/4.0;
279 (*vvfIt).second[
i][1]=(*vvfIt).second[
i][1]/(*vvfIt).second[
i][0];
280 (*vvfIt).second[
i][2]=(*vvfIt).second[
i][2]/(*vvfIt).second[
i][0];
281 (*vvfIt).second[
i][3]=(*vvfIt).second[
i][3]/(*vvfIt).second[
i][0];
283 x=(layer-1)*(*vvfIt).second.size() + (
i+1);
286 y=(*vvfIt).second[
i][1];
291 y=(*vvfIt).second[
i][2];
296 y=(*vvfIt).second[
i][3];
304 std::cout<<
"The following CSCs will go to DB"<<std::endl<<std::endl;
307 int idchmb=(*vvfIt).first/10;
316 std::cout<<count<<
" "<<
" CSC "<<(*intIt).first<<
" "
317 <<(*intIt).second<<std::endl;
355 std::cout<<
" End of CSCAFEBConnectAnalysis"<<std::endl;
void hf1ForId(std::map< int, TH1 * > &mp, int flag, const int &id, float &x, float w)
std::map< int, TH1 * > mh_WireNonPairCrosstalk
std::vector< int > nmbpulses
std::map< int, int > m_csc_list
Maps.
std::map< int, TH1 * > mh_Eff
const CSCToAFEB csctoafeb
Layer, wire to AFEB, channel conversion.
int getMaxWire(int station, int ring) const
return max. number of wiregroups per layer
std::map< int, TH1 * > mh_LayerNmbPulses
Histogram maps.
std::map< int, std::vector< std::vector< float > > > m_res_for_db
std::map< int, TH1 * > mh_WirePairCrosstalk
std::map< int, std::vector< int > > m_wire_ev
void bookForId(int flag, const int &idint, const std::string &ids)
std::map< int, TH2 * > mh_FirstTime
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
std::map< int, TH1 * > mh_PairCrosstalk
std::map< int, TH1 * > mh_NonPairCrosstalk
std::vector< CSCWireDigi >::const_iterator const_iterator
void setup(const std::string &histoFileName)
void hf2ForId(std::map< int, TH2 * > &mp, int flag, const int &id, float &x, float &y, float w)
TFile * hist_file
ROOT hist file.
std::pair< const_iterator, const_iterator > Range
std::map< int, TH1 * > mh_WireEff
void analyze(const CSCWireDigiCollection &wirecltn)