Skip to content

Commit

Permalink
Add missing std:: qualifiers and missing includes of iostream.
Browse files Browse the repository at this point in the history
  • Loading branch information
wmtan committed Sep 13, 2013
1 parent 3aaf64e commit 144e459
Show file tree
Hide file tree
Showing 162 changed files with 444 additions and 384 deletions.
8 changes: 4 additions & 4 deletions Alignment/HIPAlignmentAlgorithm/src/HIPAlignmentAlgorithm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1008,16 +1008,16 @@ HIPAlignmentAlgorithm::calcAPE(double* par, int iter, double function)
// into 0.9999999999998 in the HIPAlignmentAlgorithm::initialize is
// also used here. If I'm wrong, you'll get an assertion.
if (function == 0.) {
return max(par[1],par[0]+((par[1]-par[0])/par[2])*diter);
return std::max(par[1],par[0]+((par[1]-par[0])/par[2])*diter);
}
else if (function == 1.) {
return max(0.,par[0]*(exp(-pow(diter,par[1])/par[2])));
return std::max(0.,par[0]*(exp(-pow(diter,par[1])/par[2])));
}
else if (function == 2.) {
int ipar2 = (int) par[2];
int step = iter/ipar2;
double dstep = (double) step;
return max(0.0, par[0] - par[1]*dstep);
return std::max(0.0, par[0] - par[1]*dstep);
}
else assert(false); // should have been caught in the constructor
}
Expand Down Expand Up @@ -1148,7 +1148,7 @@ void HIPAlignmentAlgorithm::fillRoot(const edm::EventSetup& iSetup)
<< " id: " << setw(4) << m2_Id
<< " objId: " << setw(4) << m2_ObjId
<< '\n'
<< fixed << setprecision(5)
<< std::fixed << std::setprecision(5)
<< "x,y,z: "
<< setw(12) << m2_Xpos
<< setw(12) << m2_Ypos
Expand Down
6 changes: 3 additions & 3 deletions Alignment/LaserAlignment/src/LASBarrelAlgorithm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ void LASBarrelAlgorithm::Dump( void ) {


// det parameters once again without leading column (for easy read-in), into a file
ofstream file( "/afs/cern.ch/user/o/olzem/public/parameters_det.txt" );
std::ofstream file( "/afs/cern.ch/user/o/olzem/public/parameters_det.txt" );
for( int subdet = 0; subdet < 6; ++subdet ) {
for( int par = subdetParMap[subdet]; par <= subdetParMap[subdet] + 4; par += 2 ) {
minuit->GetParameter( par, value, error );
Expand Down Expand Up @@ -672,7 +672,7 @@ void LASBarrelAlgorithm::ReadMisalignmentFromFile( const char* filename,
LASGlobalData<LASCoordinateSet>& measuredCoordinates,
LASGlobalData<LASCoordinateSet>& nominalCoordinates ) {

ifstream file( filename );
std::ifstream file( filename );
if( file.bad() ) {
std::cerr << " [LASBarrelAlgorithm::ReadMisalignmentFromFile] ** ERROR: cannot open file \"" << filename << "\"." << std::endl;
return;
Expand Down Expand Up @@ -757,7 +757,7 @@ void LASBarrelAlgorithm::ReadMisalignmentFromFile( const char* filename,
///
void LASBarrelAlgorithm::ReadStartParametersFromFile( const char* filename, float values[52] ) {

ifstream file( filename );
std::ifstream file( filename );
if( file.bad() ) {
std::cerr << " [LASBarrelAlgorithm::ReadStartParametersFromFile] ** ERROR: cannot open file \"" << filename << "\"." << std::endl;
return;
Expand Down
2 changes: 1 addition & 1 deletion Alignment/MuonAlignment/plugins/MuonGeometryArrange.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ MuonGeometryArrange::MuonGeometryArrange(const edm::ParameterSet& cfg) :

// if want to use, make id cut list
if (_detIdFlag){
ifstream fin;
std::ifstream fin;
fin.open( _detIdFlagFile.c_str() );

while (!fin.eof() && fin.good() ){
Expand Down
42 changes: 21 additions & 21 deletions Alignment/TrackerAlignment/plugins/TkAlCaSkimTreeMerger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TkAlCaSkimTreeMerger : public edm::EDAnalyzer{
std::string outfilename_;//name of the file where you want to save the output

//Hit Population
typedef map<uint32_t,uint32_t>DetHitMap;
typedef std::map<uint32_t,uint32_t>DetHitMap;
DetHitMap hitmap_;
DetHitMap overlapmap_;
int maxhits_;//above this number, the hit population is prescaled. Configurable for each subdet
Expand All @@ -60,9 +60,9 @@ class TkAlCaSkimTreeMerger : public edm::EDAnalyzer{


TkAlCaSkimTreeMerger::TkAlCaSkimTreeMerger(const edm::ParameterSet &iConfig) :
filelist_(iConfig.getParameter<string>("FileList")),
treename_(iConfig.getParameter<string>("TreeName")),
outfilename_(iConfig.getParameter<string>("OutputFile")),
filelist_(iConfig.getParameter<std::string>("FileList")),
treename_(iConfig.getParameter<std::string>("TreeName")),
outfilename_(iConfig.getParameter<std::string>("OutputFile")),
// maxhits_(iConfig.getParameter<vint>("NhitsMaxLimit"))
maxhits_(iConfig.getParameter<int32_t>("NhitsMaxLimit")),
maxhitsSet_(iConfig.getParameter<edm::ParameterSet>("NhitsMaxSet"))
Expand All @@ -74,7 +74,7 @@ TkAlCaSkimTreeMerger::TkAlCaSkimTreeMerger(const edm::ParameterSet &iConfig) :
maxTOBhits_=maxhitsSet_.getParameter<int32_t>("TOBmaxhits");
maxTEChits_=maxhitsSet_.getParameter<int32_t>("TECmaxhits");
//anything you want to do for initializing
cout<<"\n\n*** MAX N HITS = "<<maxhits_<<endl<<endl;
std::cout<<"\n\n*** MAX N HITS = "<<maxhits_<<std::endl<<std::endl;
out_=0;
firsttree_=0;
ch_=0;
Expand All @@ -87,7 +87,7 @@ TkAlCaSkimTreeMerger::~TkAlCaSkimTreeMerger(){
// delete firsttree_;

delete ch_;
cout<<"finished."<<endl;
std::cout<<"finished."<<std::endl;
}

// ------------ method called before analyzing the first event ------------
Expand All @@ -97,26 +97,26 @@ void TkAlCaSkimTreeMerger::beginJob(){

//prepare the chain
ch_=new TChain(treename_.c_str());
cout<<"The chain contains "<<ch_->GetNtrees()<<" trees"<<endl;
std::cout<<"The chain contains "<<ch_->GetNtrees()<<" trees"<<std::endl;

//load the trees into the chain
ifstream flist(filelist_.c_str(),ios::in);
std::ifstream flist(filelist_.c_str(),std::ios::in);
std::string filename;
std::string firstfilename;
bool first=true;
while(!flist.eof()){
filename="";
flist>>filename;
if(filename.empty())continue;
//cout<<"Adding "<<filename<<endl;
//std::cout<<"Adding "<<filename<<std::endl;
ch_->Add(filename.c_str());
if(first){
firstfilename_=filename;
first=false;
}

}
cout<<"Now the chain contains "<<ch_->GetNtrees()<<" trees ("<<ch_->GetEntries()<<" entries)"<<endl;
std::cout<<"Now the chain contains "<<ch_->GetNtrees()<<" trees ("<<ch_->GetEntries()<<" entries)"<<std::endl;


unsigned int id_ch=0;
Expand Down Expand Up @@ -155,33 +155,33 @@ void TkAlCaSkimTreeMerger::beginJob(){
hitmap_[id_ch]=hitmap_[id_ch]+nhits_ch;
}
else{//not present, let's add this key to the map with value=1
hitmap_.insert(pair<uint32_t, uint32_t>(id_ch, nhits_ch));
hitmap_.insert(std::pair<uint32_t, uint32_t>(id_ch, nhits_ch));
}
//do the same for overlaps
overlapiter= overlapmap_.find(id_ch);
if(overlapiter!=overlapmap_.end() ){
overlapmap_[id_ch]=overlapmap_[id_ch]+noverlaps_ch;
}
else{
overlapmap_.insert(pair<uint32_t, uint32_t>(id_ch, noverlaps_ch));
overlapmap_.insert(std::pair<uint32_t, uint32_t>(id_ch, noverlaps_ch));
}

}//end loop on ent - entries in the chain


cout<<"Nhits in the chain: "<<totnhits<<endl;
cout<<"NOverlaps in the chain: "<<totnoverlaps<<endl;
std::cout<<"Nhits in the chain: "<<totnhits<<std::endl;
std::cout<<"NOverlaps in the chain: "<<totnoverlaps<<std::endl;


myclock.Stop();
cout<<"Finished beginJob after "<<myclock.RealTime()<<" s (real time) / "<<myclock.CpuTime()<<" s (cpu time)"<<endl;
std::cout<<"Finished beginJob after "<<myclock.RealTime()<<" s (real time) / "<<myclock.CpuTime()<<" s (cpu time)"<<std::endl;
myclock.Continue();
}//end beginJob


// ------------ method called to for each event ------------
void TkAlCaSkimTreeMerger::analyze(const edm::Event&, const edm::EventSetup&){
// cout<<firsttree_->GetEntries()<<endl;
// std::cout<<firsttree_->GetEntries()<<std::endl;
}//end analyze

// ------------ method called after having analyzed all the events ------------
Expand All @@ -191,7 +191,7 @@ void TkAlCaSkimTreeMerger::endJob(){
//address variables in the first tree and in the chain
TFile *firstfile=new TFile(firstfilename_.c_str(),"READ");
firsttree_=(TTree*)firstfile->Get(treename_.c_str());
cout<<"the first tree has "<<firsttree_->GetEntries() <<" entries"<<endl;
std::cout<<"the first tree has "<<firsttree_->GetEntries() <<" entries"<<std::endl;
unsigned int id=0;
uint32_t nhits=0,noverlaps=0;
float posX(-99999.0),posY(-77777.0),posZ(-88888.0);
Expand Down Expand Up @@ -257,7 +257,7 @@ void TkAlCaSkimTreeMerger::endJob(){
firsttree_->GetEntry(mod);
nhits_out=hitmap_[id];
noverlaps_out=overlapmap_[id];
// if(mod<25)cout<<"Nhits 1st tree: "<<nhits<<"\tTotal nhits chain: "<<nhits_out<<endl;
// if(mod<25)std::cout<<"Nhits 1st tree: "<<nhits<<"\tTotal nhits chain: "<<nhits_out<<std::endl;
id_out=id;
subdet_out=subdet;
layer_out=layer;
Expand Down Expand Up @@ -304,10 +304,10 @@ void TkAlCaSkimTreeMerger::endJob(){


myclock.Stop();
cout<<"Finished endJob after "<<myclock.RealTime()<<" s (real time) / "<<myclock.CpuTime()<<" s (cpu time)"<<endl;
cout<<"Ending the tree merging."<<endl;
std::cout<<"Finished endJob after "<<myclock.RealTime()<<" s (real time) / "<<myclock.CpuTime()<<" s (cpu time)"<<std::endl;
std::cout<<"Ending the tree merging."<<std::endl;
out_->Write();
cout<<"Deleting..."<<flush;
std::cout<<"Deleting..."<<std::flush;
delete firstfile;
delete outfile;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ class EcnaAnalyzer : public edm::EDAnalyzer {
unsigned int verbosity_;
Int_t nChannels_;
Int_t iEvent_; // should be removed when we can access class EventID
string eventHeaderProducer_;
string digiProducer_;
string eventHeaderCollection_;
string EBdigiCollection_;
string EEdigiCollection_;
std::string eventHeaderProducer_;
std::string digiProducer_;
std::string eventHeaderCollection_;
std::string EBdigiCollection_;
std::string EEdigiCollection_;

TString sAnalysisName_;
TString sNbOfSamples_;
Expand All @@ -175,7 +175,7 @@ class EcnaAnalyzer : public edm::EDAnalyzer {

TString fCfgAnalyzerParametersFilePath; // absolute path for the analyzer parameters files (/afs/etc...)
TString fCfgAnalyzerParametersFileName; // name of the analyzer parameters file
ifstream fFcin_f;
std::ifstream fFcin_f;

TString fAnalysisName;
Int_t fChozenGainNumber; // determined from fAnalysisName
Expand Down
Loading

0 comments on commit 144e459

Please sign in to comment.