Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75645
b: "refs/heads/CMSSW_7_1_X"
c: 42b1643
h: "refs/heads/CMSSW_7_1_X"
i:
  75643: bbfcad8
v: v3
  • Loading branch information
Anton Karneyeu committed Oct 16, 2009
1 parent 0dcd55f commit 92a4de2
Show file tree
Hide file tree
Showing 22 changed files with 163 additions and 157 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e
"refs/heads/CMSSW_7_1_X": cc210e486cec1a893cbca0b97ffb2f3c1858106f
"refs/heads/CMSSW_7_1_X": 42b16433f8c055762376fb44d703cfcf51c5019e
20 changes: 8 additions & 12 deletions trunk/EventFilter/EcalRawToDigi/interface/EcalRegionCabling.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@

class EcalRegionCabling {
public:
EcalRegionCabling(edm::ParameterSet & conf, const EcalElectronicsMapping * m): mapping_(m)
{
if (conf.exists("esMapping")){
edm::ParameterSet esMap=conf.getParameter<edm::ParameterSet>("esMapping");
es_mapping_ = new ESElectronicsMapper(esMap);
}else{
edm::LogError("EcalRegionCabling")<<"preshower mapping pointer not initialized. Temporary.";
es_mapping_=0;
}
}
EcalRegionCabling(edm::ParameterSet & conf, const EcalElectronicsMapping * m)
: mapping_(m)
{
const edm::ParameterSet esMap = conf.getParameter<edm::ParameterSet>("esMapping");
es_mapping_ = new ESElectronicsMapper(esMap);
}

~EcalRegionCabling(){
// this pointer is own by this object.
Expand Down Expand Up @@ -51,7 +47,7 @@ class EcalRegionCabling {
static uint32_t elementIndex(const int FEDindex) {
//do a test for the time being
if (FEDindex > FEDNumbering::MAXECALFEDID || FEDindex < FEDNumbering::MINECALFEDID) {
edm::LogError("EcalRegionCabling")<<"FEDindex: "<< FEDindex
edm::LogError("IncorrectMapping")<<"FEDindex: "<< FEDindex
<<" is not between: "<<(int) FEDNumbering::MINECALFEDID
<<" and "<<(int)FEDNumbering::MAXECALFEDID;
return 0;}
Expand All @@ -61,7 +57,7 @@ class EcalRegionCabling {
static uint32_t esElementIndex(const int FEDindex) {
//do a test for the time being
if (FEDindex > FEDNumbering::MAXPreShowerFEDID || FEDindex < FEDNumbering::MINPreShowerFEDID) {
edm::LogError("EcalRegionCabling")<<"FEDindex: "<< FEDindex
edm::LogError("IncorrectMapping")<<"FEDindex: "<< FEDindex
<<" is not between: "<<(int) FEDNumbering::MINPreShowerFEDID
<<" and "<<(int)FEDNumbering::MAXPreShowerFEDID;
return 0;}
Expand Down
14 changes: 9 additions & 5 deletions trunk/EventFilter/EcalRawToDigi/plugins/EcalRawToDigi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ EcalRawToDigi::EcalRawToDigi(edm::ParameterSet const& conf):
std::ostringstream output;
output <<"\n Unsuported number of xtal time samples : "<<numbXtalTSamples_
<<"\n Valid Number of xtal time samples are : 6,10,14,18,...,62";
edm::LogError("EcalRawToDigi")<< output.str();
edm::LogError("IncorrectConfiguration")<< output.str();
// todo : throw an execption
}

if( numbTriggerTSamples_ !=1 && numbTriggerTSamples_ !=4 && numbTriggerTSamples_ !=8 ){
std::ostringstream output;
output <<"\n Unsuported number of trigger time samples : "<<numbTriggerTSamples_
<<"\n Valid number of trigger time samples are : 1, 4 or 8";
edm::LogError("EcalRawToDigi")<< output.str();
edm::LogError("IncorrectConfiguration")<< output.str();
// todo : throw an execption
}

Expand Down Expand Up @@ -153,11 +153,15 @@ EcalRawToDigi::EcalRawToDigi(edm::ParameterSet const& conf):

// use two arrays from cfg to establish DCCId:FedId. If they are empy, than use hard coded correspondence
bool readResult = myMap_->makeMapFromVectors(orderedFedUnpackList_, orderedDCCIdList_);

// myMap::makeMapFromVectors() returns "true" always
// need to be fixed?

if(!readResult){
edm::LogError("EcalRawToDigi")<<"\n unable to read file : "
<<conf.getParameter<std::string>("DCCMapFile");
edm::LogWarning("IncorrectConfiguration")
<< "Arrays orderedFedList and orderedDCCIdList are emply. "
"Hard coded correspondence for DCCId:FedId will be used.";
// edm::LogError("EcalRawToDigi")<<"\n unable to read file : "
// <<conf.getParameter<std::string>("DCCMapFile");
}

// Build a new ECAL DCC data unpacker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ EcalRawToRecHitByproductProducer::produce(edm::Event& iEvent, const edm::EventSe
iSetup.get<EcalUnpackerWorkerRecord>().get(workerName_, workerESH);
const EcalUnpackerWorker * worker = dynamic_cast<const EcalUnpackerWorker *>(&*workerESH);
if (!worker)
edm::LogError("EcalRawToRecHit|Byproducts")<<"worker "<< workerName_ <<" could not be cast in EcalUnpackerWorker type."
edm::LogError("IncorrectConfiguration")<<"worker "<< workerName_ <<" could not be cast in EcalUnpackerWorker type."
<<" this must be a configuration mistake. Expect a segfault right now.";

LogDebug("EcalRawToRecHit|Byproducts")<<"worker retrieved.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ EcalRawToRecHitProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet
if (EcalNum==1) EBrechits->push_back(*iRecHit);
else if (EcalNum==2) EErechits->push_back(*iRecHit);
else {
edm::LogError("EcalRawToRecHit|Producer")<<" a subdetid is not recognized. recHit on :"<< iRecHit->id().rawId()
edm::LogError("IncorrectRecHit")<<" a subdetid is not recognized. recHit on :"<< iRecHit->id().rawId()
<<" is lost.";
}//subdetid
}//loop over things in region
Expand Down
51 changes: 28 additions & 23 deletions trunk/EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitRoI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ EcalRawToRecHitRoI::CandJobPSet::CandJobPSet(edm::ParameterSet &cfg) : CalUnpack
else if (type == "l1muon"){cType=l1muon;}
else if (type == "l1jet"){cType=l1jet;}
else {
edm::LogError("EcalRawToRecHitRoI")<<"\n\n could not interpret the cType: "<<type
edm::LogWarning("IncorrectConfiguration")<<"\n\n could not interpret the cType: "<<type
<<"\n using edm::View< reco::Candidate > by default. expect your trigger path to be slow !\n\n";
cType=view;}
}
Expand Down Expand Up @@ -108,28 +108,30 @@ EcalRawToRecHitRoI::EcalRawToRecHitRoI(const edm::ParameterSet& pset) :
}

if (!All_ && !Muon_ && !EGamma_ && !Jet_ && !Candidate_){
edm::LogError(category)<<"I have no specified type of work."
edm::LogError("IncorrectConfiguration")<<"I have no specified type of work."
<<"\nI will produce empty list of FEDs."
<<"\nI will produce an empty EcalRecHitRefGetter."
<<"\n I am sure you don't want that.";
//throw. this is a typo/omittion in a cfg.
}

produces<EcalListOfFEDS>();
produces<EcalRecHitRefGetter>();

if (pset.exists("doES")){
do_es_=pset.getParameter<bool>("doES");
if (do_es_){
LogDebug(category)<<"will also make the list of FEDs for the ES.";
sourceTag_es_=pset.getParameter<edm::InputTag>("sourceTag_es");
esinstance_=pset.getUntrackedParameter<std::string>("esInstance","es");
if (esinstance_=="") edm::LogError(category)<<" instance name for ES region and FED list cannot be empty. expect a fwk failure.";
produces<ESListOfFEDS>(esinstance_);
produces<EcalRecHitRefGetter>(esinstance_);
}
}else do_es_=false;

produces<EcalListOfFEDS>();
produces<EcalRecHitRefGetter>();

if (pset.exists("doES"))
do_es_ = pset.getParameter<bool>("doES");
else
do_es_ = false;

if (do_es_) {
LogDebug(category)<<"will also make the list of FEDs for the ES.";
sourceTag_es_=pset.getParameter<edm::InputTag>("sourceTag_es");
esinstance_=pset.getUntrackedParameter<std::string>("esInstance","es");
if (esinstance_=="")
edm::LogError("IncorrectConfiguration")<<" instance name for ES region and FED list cannot be empty. expect a fwk failure.";
produces<ESListOfFEDS>(esinstance_);
produces<EcalRecHitRefGetter>(esinstance_);
}
}


Expand Down Expand Up @@ -198,7 +200,7 @@ void EcalRawToRecHitRoI::produce(edm::Event & e, const edm::EventSetup& iSetup){
e.getByLabel(sourceTag_, lgetter);
if (lgetter.failedToGet())
{
edm::LogError(category)<<" could not retrieve the lazy getter from: "<<sourceTag_;
edm::LogError("IncorrectConfiguration")<<" could not retrieve the lazy getter from: "<<sourceTag_;
return;
}

Expand Down Expand Up @@ -245,7 +247,7 @@ void EcalRawToRecHitRoI::produce(edm::Event & e, const edm::EventSetup& iSetup){
e.getByLabel(sourceTag_es_, lgetter_es);
if (lgetter_es.failedToGet())
{
edm::LogError(category)<<" could not retrieve the lazy getter from: "<<sourceTag_es_;
edm::LogError("IncorrectConfiguration")<<" could not retrieve the lazy getter from: "<<sourceTag_es_;
return;
}

Expand Down Expand Up @@ -297,7 +299,7 @@ void EcalRawToRecHitRoI::Cand(edm::Event& e, const edm::EventSetup& es , std::ve
break;

default:
edm::LogError(category)<<"cType not recognised: "<<CandSource_[ic].cType;
edm::LogError("IncorrectRecHit")<<"cType not recognised: "<<CandSource_[ic].cType;
}
}

Expand Down Expand Up @@ -341,7 +343,7 @@ void EcalRawToRecHitRoI::Egamma(edm::Event& e, const edm::EventSetup& es , std::
uint ne=EmSource_.size();
for (uint ie=0;ie!=ne;++ie){
e.getByLabel(EmSource_[ie].Source,emColl);
if (!emColl.isValid()){edm::LogError(category)<<"L1Em Collection: "<<EmSource_[ie].Source<<" is not valid.";continue;}
if (!emColl.isValid()){edm::LogError("IncorrectConfiguration")<<"L1Em Collection: "<<EmSource_[ie].Source<<" is not valid.";continue;}

Egamma_OneL1EmCollection(emColl,EmSource_[ie],l1CaloGeom,FEDs);
}
Expand All @@ -361,7 +363,7 @@ void EcalRawToRecHitRoI::Muon(edm::Event& e, const edm::EventSetup& es, std::vec
e.getByLabel(MuonSource_.Source, muColl);
if (muColl.failedToGet())
{
edm::LogError(category)<<" could not retrieve the l1 muon collection from: "<<MuonSource_.Source;
edm::LogError("IncorrectConfiguration")<<" could not retrieve the l1 muon collection from: "<<MuonSource_.Source;
return;
}

Expand Down Expand Up @@ -410,7 +412,10 @@ void EcalRawToRecHitRoI::Jet(edm::Event& e, const edm::EventSetup& es, std::vect
uint nj=JetSource_.size();
for (uint ij=0;ij!=nj;++ij){
e.getByLabel(JetSource_[ij].Source,jetColl);
if (!jetColl.isValid()){edm::LogError(category)<<"L1Jet collection: "<<JetSource_[ij].Source<<" is not valid.";continue;}
if (!jetColl.isValid()) {
edm::LogError("IncorrectConfiguration") << "L1Jet collection: " << JetSource_[ij].Source << " is not valid.";
continue;
}

Jet_OneL1JetCollection(jetColl,JetSource_[ij],FEDs);
}
Expand Down
11 changes: 7 additions & 4 deletions trunk/EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitRoI.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ template <typename CollectionType> void EcalRawToRecHitRoI::OneCandCollection(co

edm::Handle<CollectionType> candColl;
e.getByLabel(cjpset.Source, candColl);
if (candColl.failedToGet()) {edm::LogError(category)<<"could not get: "<<cjpset.Source<<" of type: "<<cjpset.cType; return;}
if (candColl.failedToGet()) {
edm::LogError("IncorrectConfiguration")<<"could not get: "<<cjpset.Source<<" of type: "<<cjpset.cType;
return;
}

typename CollectionType::const_iterator it = candColl->begin();
typename CollectionType::const_iterator end= candColl->end();
Expand All @@ -196,8 +199,8 @@ template <typename CollectionType> void EcalRawToRecHitRoI::OneCandCollection(co
GlobalVector vector(it->px(),it->py(),it->pz());

if (point.mag()==0 && vector.mag()==0){
edm::LogWarning(category)<<" state of candidate is not valid. skipping.";
continue;
edm::LogWarning("IncorrectRecHit")<<" state of candidate is not valid. skipping.";
continue;
}

FreeTrajectoryState fts(point, vector, it->charge(), propH->magneticField());
Expand All @@ -211,7 +214,7 @@ template <typename CollectionType> void EcalRawToRecHitRoI::OneCandCollection(co
eta= point.eta();
phi= point.phi();
}
else{edm::LogError(category)<<"I tried to be precise, but propagation failed. from:\n"<<fts;
else{edm::LogWarning("IncorrectRecHit")<<"I tried to be precise, but propagation failed. from:\n"<<fts;
continue;}
}

Expand Down
26 changes: 13 additions & 13 deletions trunk/EventFilter/EcalRawToDigi/plugins/MatacqProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ MatacqProducer::addMatacqData(edm::Event& event){
if(doOrbitOffset_){
map<uint32_t,uint32_t>::iterator it = orbitOffset_.find(runNumber);
if(it == orbitOffset_.end()){
LogWarning("Matacq") << "Orbit offset not found for run "
LogWarning("IncorrectLaserEvent") << "Orbit offset not found for run "
<< runNumber
<< ". No orbit correction will be applied.";
} else{
Expand All @@ -173,7 +173,7 @@ MatacqProducer::addMatacqData(edm::Event& event){
if(produceRaw_){
uint32_t dataLen64 = matacq_.getParsedLen();
if(dataLen64 > bufferSize*8 || matacq_.getDccLen()!= dataLen64){
LogWarning("Matacq") << " Error in Matacq event fragment length! "
LogWarning("IncorrectLaserEvent") << " Error in Matacq event fragment length! "
<< "DCC len: " << matacq_.getDccLen()
<< "*8 Bytes, Parsed len: "
<< matacq_.getParsedLen() << "*8 Bytes. "
Expand All @@ -194,11 +194,11 @@ MatacqProducer::addMatacqData(edm::Event& event){
++stats_.nNonLaserEventsWithMatacq;
}
} else{
LogWarning("Matacq") << "No matacq data found for "
LogWarning("IncorrectLaserEvent") << "No matacq data found for "
<< "run " << runNumber << " orbit " << orbitId;
}
} else{
LogWarning("Matacq") << "No matacq file found for event "
LogWarning("IncorrectLaserEvent") << "No matacq file found for event "
<< event.id();
}
}
Expand Down Expand Up @@ -320,7 +320,7 @@ MatacqProducer::getMatacqEvent(uint32_t runNumber,
}
}
} else{
LogWarning("Matacq") << "Failed to access file " << inFileName_ << ".";
LogWarning("IncorrectConfiguration") << "Failed to access file " << inFileName_ << ".";
}
if(pos>=0){
if(verbosity_>2) cout << "[Matacq] jumping to estimated position "
Expand Down Expand Up @@ -498,7 +498,7 @@ MatacqProducer::getMatacqFile(uint32_t runNumber, uint32_t orbitId,
}

if(!mopen(fname)){
LogWarning("Matacq") << "Failed to open file " << fname << "\n";
LogWarning("IncorrectConfiguration") << "Failed to open file " << fname << "\n";
openedFileRunNumber_ = 0;
if(fileChange!=0) *fileChange = false;
return false;
Expand Down Expand Up @@ -542,7 +542,7 @@ uint32_t MatacqProducer::getOrbitId(edm::Event& ev) const{
if(orbit!=0 && thisOrbit!=0 && abs(orbit-thisOrbit)>orbitTolerance_){
//throw cms::Exception("EventCorruption")
// << "Orbit ID inconsitency in DCC headers";
LogWarning("EventCorruption")
LogWarning("IncorrectEvent")
<< "Orbit ID inconsitency in DCC headers";
orbit = 0;
break;
Expand All @@ -554,7 +554,7 @@ uint32_t MatacqProducer::getOrbitId(edm::Event& ev) const{
if(orbit==0){
// throw cms::Exception("NotFound")
// << "Failed to retrieve orbit ID of event "<< ev.id();
LogWarning("NotFound") << "Failed to retrieve orbit ID of event "
LogWarning("IncorrectEvent") << "Failed to retrieve orbit ID of event "
<< ev.id();
}
return orbit;
Expand Down Expand Up @@ -583,12 +583,12 @@ int MatacqProducer::getCalibTriggerType(edm::Event& ev) const{
int tType = stat.result(&p);
if(p<0){
//throw cms::Exception("NotFound") << "No ECAL DCC data found\n";
LogWarning("NotFound") << "No ECAL DCC data found\n";
LogWarning("IncorrectEvent") << "No ECAL DCC data found\n";
tType = -1;
}
if(p<.8){
//throw cms::Exception("EventCorruption") << "Inconsitency in detailed trigger type indicated in ECAL DCC data headers\n";
LogWarning("EventCorruption") << "Inconsitency in detailed trigger type indicated in ECAL DCC data headers\n";
LogWarning("IncorrectEvent") << "Inconsitency in detailed trigger type indicated in ECAL DCC data headers\n";
tType = -1;
}
return tType;
Expand Down Expand Up @@ -638,7 +638,7 @@ void MatacqProducer::PosEstimator::init(MatacqProducer* mp){
mp->mseek(last, SEEK_SET, "Moving to beginning of last complete "
"matacq event");
if(!mp->mread((char*) data, headerSize, "Reading matacq header", true)){
LogWarning("Matacq") << "Fast matacq event retrieval failure. "
LogWarning("IncorrectLaserEvent") << "Fast matacq event retrieval failure. "
"Falling back to safe retrieval mode.";
orbitStepMean_ = 0;
}
Expand All @@ -651,7 +651,7 @@ void MatacqProducer::PosEstimator::init(MatacqProducer* mp){

//some consistency check
if(lastLen!=eventLength_){
LogWarning("Matacq")
LogWarning("IncorrectLaserEvent")
<< "Fast matacq event retrieval failure: it looks like "
"the matacq file contains events of different sizes. Falling back to "
"safe retrieval mode.";
Expand Down Expand Up @@ -828,7 +828,7 @@ bool MatacqProducer::mopen(const std::string& name){
IOFlags::OpenRead));
inFileName_ = name;
} catch(cms::Exception& e){
LogWarning("Matacq") << e.what();
LogWarning("IncorrectConfiguration") << e.what();
inFile_.reset();
inFileName_ = "";
return false;
Expand Down
Loading

0 comments on commit 92a4de2

Please sign in to comment.