Skip to content

Commit

Permalink
and code checks
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlange6 committed Aug 23, 2019
1 parent 12ff73e commit 50b184b
Show file tree
Hide file tree
Showing 99 changed files with 2,493 additions and 2,588 deletions.
1 change: 0 additions & 1 deletion CalibCalorimetry/HcalTPGAlgos/interface/HcalEmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <cstring>
#include <fstream>


#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"

class HcalEmap {
Expand Down
1 change: 0 additions & 1 deletion CalibCalorimetry/HcalTPGAlgos/interface/XMLDOMBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
// Created: Thu Sep 27 01:46:46 CEST 2007
//


#include <string>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/sax/HandlerBase.hpp>
Expand Down
1 change: 0 additions & 1 deletion CalibFormats/CaloTPG/interface/CaloTPGTranscoder.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef CALIBFORMATS_CALOTPG_CALOTPGTRANSCODER_H
#define CALIBFORMATS_CALOTPG_CALOTPGTRANSCODER_H 1


#include "DataFormats/HcalDetId/interface/HcalTrigTowerDetId.h"
#include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h"
#include "DataFormats/HcalDigi/interface/HcalTriggerPrimitiveSample.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef SiStripQualityHistos_H
#define SiStripQualityHistos_H


#include <ext/hash_map>
#include "TH1F.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

#include "CalibFormats/SiStripObjects/interface/SiStripQuality.h"

#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/TrackerRecHit2D/interface/ProjectedSiStripRecHit2D.h"
#include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h"
#include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
#include "Geometry/Records/interface/TrackerTopologyRcd.h"
#include <iostream>
#include <fstream>
#include <iostream>
#include <memory>
#include <sstream>

//Insert here the include to the algos
Expand Down Expand Up @@ -129,7 +130,7 @@ void SiStripQualityHotStripIdentifier::bookHistos() {
SiStrip::QualityHistosMap::iterator ref = ClusterPositionHistoMap.find(it->first);
if (ref == ClusterPositionHistoMap.end()) {
ClusterPositionHistoMap[it->first] =
std::shared_ptr<TH1F>(new TH1F(hname, hname, it->second.nApvs * 128, -0.5, it->second.nApvs * 128 - 0.5));
std::make_shared<TH1F>(hname, hname, it->second.nApvs * 128, -0.5, it->second.nApvs * 128 - 0.5);
} else
edm::LogError("SiStripQualityHotStripIdentifier")
<< " [SiStripQualityHotStripIdentifier::bookHistos] DetId " << it->first
Expand Down
1 change: 0 additions & 1 deletion CaloOnlineTools/HcalOnlineDb/interface/LMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <cstring>
#include <fstream>


#include "CaloOnlineTools/HcalOnlineDb/interface/ConfigurationDatabase.hh"
#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
#include "CondFormats/HcalObjects/interface/HcalElectronicsMap.h"
Expand Down
1 change: 0 additions & 1 deletion CommonTools/Utils/src/BinarySelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "CommonTools/Utils/src/ExpressionBase.h"
#include "CommonTools/Utils/src/ComparisonBase.h"


namespace reco {
namespace parser {
struct BinarySelector : public SelectorBase {
Expand Down
1 change: 0 additions & 1 deletion CommonTools/Utils/src/BinarySelectorSetter.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "CommonTools/Utils/src/BinarySelector.h"
#include "CommonTools/Utils/interface/Exception.h"


namespace reco {
namespace parser {
class BinarySelectorSetter {
Expand Down
1 change: 0 additions & 1 deletion CommonTools/Utils/src/MethodInvoker.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "FWCore/Reflection/interface/ObjectWithDict.h"
#include "FWCore/Utilities/interface/TypeID.h"


#include <boost/utility.hpp>

#include <map>
Expand Down
1 change: 0 additions & 1 deletion CommonTools/Utils/src/TrinarySelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "CommonTools/Utils/src/ExpressionBase.h"
#include "CommonTools/Utils/src/ComparisonBase.h"


namespace reco {
namespace parser {
struct TrinarySelector : public SelectorBase {
Expand Down
1 change: 0 additions & 1 deletion CommonTools/Utils/src/TrinarySelectorSetter.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "CommonTools/Utils/src/ExpressionStack.h"
#include "CommonTools/Utils/src/TrinarySelector.h"


namespace reco {
namespace parser {
class TrinarySelectorSetter {
Expand Down
98 changes: 49 additions & 49 deletions CondCore/ESSources/test/testWriteCondData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,94 +9,94 @@
#include "FWCore/PluginManager/interface/standard.h"
#include <iostream>

int main(){
try{
int main() {
try {
// for runnumber
cond::TimeType timetype = cond::runnumber;
cond::Time_t globalTill = cond::timeTypeSpecs[timetype].endValue;
edmplugin::PluginManager::Config config;
edmplugin::PluginManager::configure(edmplugin::standard::config());

cond::DbConnection connection;
connection.configuration().setMessageLevel( coral::Error );
connection.configuration().setMessageLevel(coral::Error);
connection.configuration().setAuthenticationPath(".");
connection.configure();
cond::DbSession session = connection.createSession();
session.open( "sqlite_file:test.db" );
session.open("sqlite_file:test.db");

cond::IOVEditor ioveditor( session );
cond::IOVEditor ioveditor(session);
session.transaction().start(false);
std::cout<<"globalTill value "<<globalTill<<std::endl;
ioveditor.create(timetype,globalTill);
for(unsigned int i=0; i<3; ++i){ //inserting 3 payloads
std::shared_ptr<Pedestals> myped( new Pedestals );
for(int ichannel=1; ichannel<=5; ++ichannel){
std::cout << "globalTill value " << globalTill << std::endl;
ioveditor.create(timetype, globalTill);
for (unsigned int i = 0; i < 3; ++i) { //inserting 3 payloads
std::shared_ptr<Pedestals> myped(new Pedestals);
for (int ichannel = 1; ichannel <= 5; ++ichannel) {
Pedestals::Item item;
item.m_mean=1.11*ichannel+i;
item.m_variance=1.12*ichannel+i*2;
item.m_mean = 1.11 * ichannel + i;
item.m_variance = 1.12 * ichannel + i * 2;
myped->m_pedestals.push_back(item);
}
std::string payloadToken = session.storeObject(myped.get(),"PedestalsRcd");
ioveditor.append(cond::Time_t(2+2*i),payloadToken);
std::string payloadToken = session.storeObject(myped.get(), "PedestalsRcd");
ioveditor.append(cond::Time_t(2 + 2 * i), payloadToken);
}
//last one
std::shared_ptr<Pedestals> myped( new Pedestals );
for(int ichannel=1; ichannel<=5; ++ichannel){
std::shared_ptr<Pedestals> myped(new Pedestals);
for (int ichannel = 1; ichannel <= 5; ++ichannel) {
Pedestals::Item item;
item.m_mean=3.11*ichannel;
item.m_variance=5.12*ichannel;
item.m_mean = 3.11 * ichannel;
item.m_variance = 5.12 * ichannel;
myped->m_pedestals.push_back(item);
}
std::string payloadToken = session.storeObject(myped.get(),"PedestalsRcd");
ioveditor.append(9001,payloadToken);
std::string iovtoken=ioveditor.token();
std::cout<<"iov token "<<iovtoken<<std::endl;
std::string payloadToken = session.storeObject(myped.get(), "PedestalsRcd");
ioveditor.append(9001, payloadToken);
std::string iovtoken = ioveditor.token();
std::cout << "iov token " << iovtoken << std::endl;
session.transaction().commit();
//pooldb.disconnect();
session.transaction().start(false);
ioveditor.create(timetype, globalTill);
std::shared_ptr<Pedestals> p( new Pedestals );
for(int ichannel=1; ichannel<=2; ++ichannel){
std::shared_ptr<Pedestals> p(new Pedestals);
for (int ichannel = 1; ichannel <= 2; ++ichannel) {
Pedestals::Item item;
item.m_mean=4.11*ichannel;
item.m_variance=5.82*ichannel;
item.m_mean = 4.11 * ichannel;
item.m_variance = 5.82 * ichannel;
p->m_pedestals.push_back(item);
}
std::string payloadToken2 = session.storeObject(p.get(),"PedestalsRcd");
ioveditor.append(90001,payloadToken2);
std::string pediovtoken=ioveditor.token();
std::cout<<"iov token "<<pediovtoken<<std::endl;
std::string payloadToken2 = session.storeObject(p.get(), "PedestalsRcd");
ioveditor.append(90001, payloadToken2);
std::string pediovtoken = ioveditor.token();
std::cout << "iov token " << pediovtoken << std::endl;
session.transaction().commit();
//
///I write different pedestals in another record
//
cond::IOVEditor anotherioveditor( session );
cond::IOVEditor anotherioveditor(session);
session.transaction().start(false);
anotherioveditor.create(timetype,globalTill);
for(unsigned int i=0; i<2; ++i){ //inserting 2 payloads to another Rcd
std::shared_ptr<Pedestals> myped( new Pedestals );
for(int ichannel=1; ichannel<=3; ++ichannel){
anotherioveditor.create(timetype, globalTill);
for (unsigned int i = 0; i < 2; ++i) { //inserting 2 payloads to another Rcd
std::shared_ptr<Pedestals> myped(new Pedestals);
for (int ichannel = 1; ichannel <= 3; ++ichannel) {
Pedestals::Item item;
item.m_mean=1.11*ichannel+i;
item.m_variance=1.12*ichannel+i*2;
item.m_mean = 1.11 * ichannel + i;
item.m_variance = 1.12 * ichannel + i * 2;
myped->m_pedestals.push_back(item);
}
std::string payloadToken = session.storeObject(myped.get(),"anotherPedestalsRcd");
anotherioveditor.append(cond::Time_t(2+2*i),payloadToken);
std::string payloadToken = session.storeObject(myped.get(), "anotherPedestalsRcd");
anotherioveditor.append(cond::Time_t(2 + 2 * i), payloadToken);
}
std::string anotheriovtoken=anotherioveditor.token();
std::cout<<"anotheriovtoken "<<anotheriovtoken<<std::endl;
std::string anotheriovtoken = anotherioveditor.token();
std::cout << "anotheriovtoken " << anotheriovtoken << std::endl;
session.transaction().commit();

cond::MetaData metadata(session);
session.transaction().start(false);
metadata.addMapping("mytest",iovtoken,cond::runnumber);
metadata.addMapping("pedtag",pediovtoken,cond::runnumber);
metadata.addMapping("anothermytest",anotheriovtoken,cond::runnumber);
metadata.addMapping("mytest", iovtoken, cond::runnumber);
metadata.addMapping("pedtag", pediovtoken, cond::runnumber);
metadata.addMapping("anothermytest", anotheriovtoken, cond::runnumber);
session.transaction().commit();
}catch(const cond::Exception& er){
std::cout<<"error "<<er.what()<<std::endl;
}catch(const std::exception& er){
std::cout<<"std error "<<er.what()<<std::endl;
} catch (const cond::Exception& er) {
std::cout << "error " << er.what() << std::endl;
} catch (const std::exception& er) {
std::cout << "std error " << er.what() << std::endl;
}
}
Loading

0 comments on commit 50b184b

Please sign in to comment.