@@ -66,7 +66,7 @@ class TreeBranch {
6666 }
6767 const std::string& branchAlias () const { return branchAlias_; }
6868 const std::string& branchTitle () const { return branchTitle_; }
69- typedef std::unique_ptr<std::vector<float > > value;
69+ typedef std::unique_ptr<std::vector<float >> value;
7070 value branch (const edm::Event& iEvent);
7171
7272 std::vector<float >** dataHolderPtrAdress () { return &dataHolderPtr_; }
@@ -100,12 +100,12 @@ class StringLeaveHelper {
100100 // empty vector if product not found
101101 if (oH.failedToGet ()) {
102102 edm::LogError (" StringBranchHelper" ) << " cannot open: " << B.src ();
103- value_. reset ( new std::vector<float >( 0 ) );
103+ value_ = std::make_unique<std:: vector<float >>( 0 );
104104 } else {
105105 // parser for the object expression
106106 StringObjectFunction<Object> expr (B.expr ());
107107 // allocate enough memory for the data holder
108- value_. reset ( new std::vector<float >( 1 ) );
108+ value_ = std::make_unique<std:: vector<float >>( 1 );
109109 try {
110110 (*value_)[0 ] = (expr)(*oH);
111111 } catch (...) {
@@ -120,7 +120,7 @@ class StringLeaveHelper {
120120 value value_;
121121};
122122
123- template <typename Object, typename Collection = std::vector<Object> >
123+ template <typename Object, typename Collection = std::vector<Object>>
124124class StringBranchHelper {
125125public:
126126 typedef TreeBranch::value value;
@@ -138,12 +138,12 @@ class StringBranchHelper {
138138 if (!(iEvent.isRealData () && B.className () == " reco::GenParticle" )) { // don't output genparticle error in data
139139 edm::LogError (" StringBranchHelper" ) << " cannot open: " << B.src () << " " << B.className ();
140140 }
141- value_. reset ( new std::vector<float >() );
141+ value_ = std::make_unique<std:: vector<float >>( );
142142 } else {
143143 // parser for the object expression
144144 StringObjectFunction<Object> expr (B.expr ());
145145 // allocate enough memory for the data holder
146- value_. reset ( new std::vector<float >() );
146+ value_ = std::make_unique<std:: vector<float >>( );
147147 value_->reserve (oH->size ());
148148
149149 StringCutObjectSelector<Object>* selection = nullptr ;
@@ -233,17 +233,17 @@ class StringBasedNTupler : public NTupler {
233233
234234 // do it once with configuration [vstring vars = { "x:x" ,... } ] where ":"=separator
235235 if (leavesPSet.exists (" vars" )) {
236- std::vector<std::string> leavesS = leavesPSet.getParameter <std::vector<std::string> >(" vars" );
236+ std::vector<std::string> leavesS = leavesPSet.getParameter <std::vector<std::string>>(" vars" );
237237 for (uint l = 0 ; l != leavesS.size (); ++l) {
238238 uint sep = leavesS[l].find (separator);
239239 std::string name = leavesS[l].substr (0 , sep);
240240 // removes spaces from the variable name
241- /* uint*/ int space = name.find (" " );
241+ /* uint*/ int space = name.find (' ' );
242242 while (space != -1 /* std::string::npos*/ ) {
243243 std::string first = name.substr (0 , space);
244244 std::string second = name.substr (space + 1 );
245245 name = first + second;
246- space = name.find (" " );
246+ space = name.find (' ' );
247247 }
248248 std::string expr = leavesS[l].substr (sep + 1 );
249249 std::string branchAlias = branches[b] + " _" + name;
@@ -347,7 +347,7 @@ class StringBasedNTupler : public NTupler {
347347 for (; iL != iL_end; ++iL) {
348348 TreeBranch& b = *iL;
349349 // a vector of float for each leave
350- producesCollector.produces <std::vector<float > >(b.branchName ()).setBranchAlias (b.branchAlias ());
350+ producesCollector.produces <std::vector<float >>(b.branchName ()).setBranchAlias (b.branchAlias ());
351351 nLeaves++;
352352 }
353353 }
@@ -371,7 +371,7 @@ class StringBasedNTupler : public NTupler {
371371 for (; iL != iL_end; ++iL) {
372372 TreeBranch& b = *iL;
373373 // grab the vector of values from the interpretation of expression for the associated collection
374- std::unique_ptr<std::vector<float > > branch (b.branch (iEvent));
374+ std::unique_ptr<std::vector<float >> branch (b.branch (iEvent));
375375 // calculate the maximum index size.
376376 if (branch->size () > maxS)
377377 maxS = branch->size ();
@@ -430,7 +430,7 @@ class StringBasedNTupler : public NTupler {
430430 uint maxS = 0 ;
431431 for (; iL != iL_end; ++iL) {
432432 TreeBranch& b = *iL;
433- std::unique_ptr<std::vector<float > > branch (b.branch (iEvent));
433+ std::unique_ptr<std::vector<float >> branch (b.branch (iEvent));
434434 if (branch->size () > maxS)
435435 maxS = branch->size ();
436436 iEvent.put (std::move (branch), b.branchName ());
@@ -470,7 +470,7 @@ class StringBasedNTupler : public NTupler {
470470 }
471471
472472protected:
473- typedef std::map<std::string, std::vector<TreeBranch> > Branches;
473+ typedef std::map<std::string, std::vector<TreeBranch>> Branches;
474474 Branches branches_;
475475
476476 bool ownTheTree_;
0 commit comments