@@ -72,26 +72,26 @@ void DumpFileToDB::endJob() {
7272 // ---------- VDrift
7373 if (dbToDump == " VDriftDB" ) {
7474 if (format == " Legacy" ) {
75- DTMtime* mtime = new DTMtime () ;
75+ DTMtime mtime;
7676 for (DTCalibrationMap::const_iterator keyAndCalibs = theCalibFile->keyAndConsts_begin ();
7777 keyAndCalibs != theCalibFile->keyAndConsts_end ();
7878 ++keyAndCalibs) {
7979 // cout << "key: " << (*keyAndCalibs).first
8080 // << " vdrift (cm/ns): " << theCalibFile->meanVDrift((*keyAndCalibs).first)
8181 // << " hit reso (cm): " << theCalibFile->sigma_meanVDrift((*keyAndCalibs).first) << endl;
8282 // vdrift is cm/ns , resolution is cm
83- mtime-> set ((*keyAndCalibs).first .superlayerId (),
84- theCalibFile->meanVDrift ((*keyAndCalibs).first ),
85- theCalibFile->sigma_meanVDrift ((*keyAndCalibs).first ),
86- DTVelocityUnits::cm_per_ns);
83+ mtime. set ((*keyAndCalibs).first .superlayerId (),
84+ theCalibFile->meanVDrift ((*keyAndCalibs).first ),
85+ theCalibFile->sigma_meanVDrift ((*keyAndCalibs).first ),
86+ DTVelocityUnits::cm_per_ns);
8787 }
8888 DTCalibDBUtils::writeToDB<DTMtime>(" DTMtimeRcd" , mtime);
8989 } else if (format == " DTRecoConditions" ) {
90- DTRecoConditions* conds = new DTRecoConditions () ;
91- conds-> setFormulaExpr (" [0]" );
92- // conds-> setFormulaExpr("[0]*(1-[1]*x)");
90+ DTRecoConditions conds;
91+ conds. setFormulaExpr (" [0]" );
92+ // conds. setFormulaExpr("[0]*(1-[1]*x)");
9393 int version = 1 ;
94- conds-> setVersion (version);
94+ conds. setVersion (version);
9595 for (DTCalibrationMap::const_iterator keyAndCalibs = theCalibFile->keyAndConsts_begin ();
9696 keyAndCalibs != theCalibFile->keyAndConsts_end ();
9797 ++keyAndCalibs) {
@@ -107,15 +107,15 @@ void DumpFileToDB::endJob() {
107107 throw cms::Exception (" IncorrectSetup" ) << " Inconsistent version of file" ;
108108
109109 vector<double > params (values.begin () + 11 , values.begin () + 11 + nfields);
110- conds-> set ((*keyAndCalibs).first , params);
110+ conds. set ((*keyAndCalibs).first , params);
111111 }
112112 DTCalibDBUtils::writeToDB<DTRecoConditions>(" DTRecoConditionsVdriftRcd" , conds);
113113 }
114114
115115 // ---------- TTrig
116116 } else if (dbToDump == " TTrigDB" ) {
117117 if (format == " Legacy" ) {
118- DTTtrig* tTrig = new DTTtrig () ;
118+ DTTtrig tTrig;
119119 for (DTCalibrationMap::const_iterator keyAndCalibs = theCalibFile->keyAndConsts_begin ();
120120 keyAndCalibs != theCalibFile->keyAndConsts_end ();
121121 ++keyAndCalibs) {
@@ -131,11 +131,11 @@ void DumpFileToDB::endJob() {
131131 << " The differentialMode can only be used with kFactor = 0, old: " << kFactor
132132 << " new: " << theCalibFile->kFactor ((*keyAndCalibs).first );
133133 }
134- tTrig-> set ((*keyAndCalibs).first .superlayerId (),
135- theCalibFile->tTrig ((*keyAndCalibs).first ) + tmean,
136- theCalibFile->sigma_tTrig ((*keyAndCalibs).first ),
137- theCalibFile->kFactor ((*keyAndCalibs).first ),
138- DTTimeUnits::ns);
134+ tTrig. set ((*keyAndCalibs).first .superlayerId (),
135+ theCalibFile->tTrig ((*keyAndCalibs).first ) + tmean,
136+ theCalibFile->sigma_tTrig ((*keyAndCalibs).first ),
137+ theCalibFile->kFactor ((*keyAndCalibs).first ),
138+ DTTimeUnits::ns);
139139 // cout << "key: " << (*keyAndCalibs).first
140140 // << " ttrig_mean (ns): " << theCalibFile->tTrig((*keyAndCalibs).first) + tmean
141141 // << " ttrig_sigma(ns): " << theCalibFile->sigma_tTrig((*keyAndCalibs).first)
@@ -146,20 +146,20 @@ void DumpFileToDB::endJob() {
146146 // << " ttrig_mean (ns): " << theCalibFile->tTrig((*keyAndCalibs).first)
147147 // << " ttrig_sigma(ns): " << theCalibFile->sigma_tTrig((*keyAndCalibs).first)
148148 // << " kFactor: " << theCalibFile->kFactor((*keyAndCalibs).first) << endl;
149- tTrig-> set ((*keyAndCalibs).first .superlayerId (),
150- theCalibFile->tTrig ((*keyAndCalibs).first ),
151- theCalibFile->sigma_tTrig ((*keyAndCalibs).first ),
152- theCalibFile->kFactor ((*keyAndCalibs).first ),
153- DTTimeUnits::ns);
149+ tTrig. set ((*keyAndCalibs).first .superlayerId (),
150+ theCalibFile->tTrig ((*keyAndCalibs).first ),
151+ theCalibFile->sigma_tTrig ((*keyAndCalibs).first ),
152+ theCalibFile->kFactor ((*keyAndCalibs).first ),
153+ DTTimeUnits::ns);
154154 }
155155 }
156156 DTCalibDBUtils::writeToDB<DTTtrig>(" DTTtrigRcd" , tTrig);
157157
158158 } else if (format == " DTRecoConditions" ) {
159- DTRecoConditions* conds = new DTRecoConditions () ;
160- conds-> setFormulaExpr (" [0]" );
159+ DTRecoConditions conds;
160+ conds. setFormulaExpr (" [0]" );
161161 int version = 1 ;
162- conds-> setVersion (version);
162+ conds. setVersion (version);
163163
164164 for (DTCalibrationMap::const_iterator keyAndCalibs = theCalibFile->keyAndConsts_begin ();
165165 keyAndCalibs != theCalibFile->keyAndConsts_end ();
@@ -177,15 +177,15 @@ void DumpFileToDB::endJob() {
177177 throw cms::Exception (" IncorrectSetup" ) << " Inconsistent version of file" ;
178178
179179 vector<double > params (values.begin () + 11 , values.begin () + 11 + nfields);
180- conds-> set ((*keyAndCalibs).first , params);
180+ conds. set ((*keyAndCalibs).first , params);
181181 }
182182 DTCalibDBUtils::writeToDB<DTRecoConditions>(" DTRecoConditionsTtrigRcd" , conds);
183183 }
184184
185185 } else if (dbToDump == " TZeroDB" ) { // Write the T0
186186
187187 // Create the object to be written to DB
188- DTT0* tZeroMap = new DTT0 () ;
188+ DTT0 tZeroMap;
189189
190190 // Loop over file entries
191191 for (DTCalibrationMap::const_iterator keyAndCalibs = theCalibFile->keyAndConsts_begin ();
@@ -195,40 +195,40 @@ void DumpFileToDB::endJob() {
195195 float t0rms = (*keyAndCalibs).second [6 ];
196196 cout << " key: " << (*keyAndCalibs).first << " T0 mean (TDC counts): " << t0mean
197197 << " T0_rms (TDC counts): " << t0rms << endl;
198- tZeroMap-> set ((*keyAndCalibs).first , t0mean, t0rms, DTTimeUnits::counts);
198+ tZeroMap. set ((*keyAndCalibs).first , t0mean, t0rms, DTTimeUnits::counts);
199199 }
200200
201201 DTCalibDBUtils::writeToDB<DTT0>(" DTT0Rcd" , tZeroMap);
202202
203203 } else if (dbToDump == " NoiseDB" ) { // Write the Noise
204- DTStatusFlag* statusMap = new DTStatusFlag () ;
204+ DTStatusFlag statusMap;
205205
206206 // Loop over file entries
207207 for (DTCalibrationMap::const_iterator keyAndCalibs = theCalibFile->keyAndConsts_begin ();
208208 keyAndCalibs != theCalibFile->keyAndConsts_end ();
209209 ++keyAndCalibs) {
210210 cout << " key: " << (*keyAndCalibs).first << " Noisy flag: " << (*keyAndCalibs).second [7 ] << endl;
211- statusMap-> setCellNoise ((*keyAndCalibs).first , (*keyAndCalibs).second [7 ]);
211+ statusMap. setCellNoise ((*keyAndCalibs).first , (*keyAndCalibs).second [7 ]);
212212 }
213213
214214 DTCalibDBUtils::writeToDB<DTStatusFlag>(" DTStatusFlagRcd" , statusMap);
215215
216216 } else if (dbToDump == " DeadDB" ) { // Write the tp-dead
217- DTDeadFlag* deadMap = new DTDeadFlag () ;
217+ DTDeadFlag deadMap;
218218
219219 // Loop over file entries
220220 for (DTCalibrationMap::const_iterator keyAndCalibs = theCalibFile->keyAndConsts_begin ();
221221 keyAndCalibs != theCalibFile->keyAndConsts_end ();
222222 ++keyAndCalibs) {
223223 cout << " key: " << (*keyAndCalibs).first << " dead flag: " << (*keyAndCalibs).second [7 ] << endl;
224- deadMap-> setCellDead_TP ((*keyAndCalibs).first , (*keyAndCalibs).second [7 ]);
224+ deadMap. setCellDead_TP ((*keyAndCalibs).first , (*keyAndCalibs).second [7 ]);
225225 }
226226
227227 DTCalibDBUtils::writeToDB<DTDeadFlag>(" DTDeadFlagRcd" , deadMap);
228228
229229 } else if (dbToDump == " ChannelsDB" ) { // Write channels map
230230
231- DTReadOutMapping* ro_map = new DTReadOutMapping (" cmssw_ROB" , " cmssw_ROS" );
231+ DTReadOutMapping ro_map (" cmssw_ROB" , " cmssw_ROS" );
232232 // Loop over file entries
233233 string line;
234234 ifstream file (mapFileName.c_str ());
@@ -238,17 +238,17 @@ void DumpFileToDB::endJob() {
238238 stringstream linestr;
239239 linestr << line;
240240 vector<int > channelMap = readChannelsMap (linestr);
241- int status = ro_map-> insertReadOutGeometryLink (channelMap[0 ],
242- channelMap[1 ],
243- channelMap[2 ],
244- channelMap[3 ],
245- channelMap[4 ],
246- channelMap[5 ],
247- channelMap[6 ],
248- channelMap[7 ],
249- channelMap[8 ],
250- channelMap[9 ],
251- channelMap[10 ]);
241+ int status = ro_map. insertReadOutGeometryLink (channelMap[0 ],
242+ channelMap[1 ],
243+ channelMap[2 ],
244+ channelMap[3 ],
245+ channelMap[4 ],
246+ channelMap[5 ],
247+ channelMap[6 ],
248+ channelMap[7 ],
249+ channelMap[8 ],
250+ channelMap[9 ],
251+ channelMap[10 ]);
252252 cout << " ddu " << channelMap[0 ] << " "
253253 << " ros " << channelMap[1 ] << " "
254254 << " rob " << channelMap[2 ] << " "
@@ -268,10 +268,10 @@ void DumpFileToDB::endJob() {
268268 // ---------- Uncertainties
269269 } else if (dbToDump == " RecoUncertDB" ) { // Write the Uncertainties
270270
271- DTRecoConditions* conds = new DTRecoConditions () ;
272- conds-> setFormulaExpr (" par[step]" );
271+ DTRecoConditions conds;
272+ conds. setFormulaExpr (" par[step]" );
273273 int version = 1 ; // Uniform uncertainties per SL and step; parameters 0-3 are for steps 1-4.
274- conds-> setVersion (version);
274+ conds. setVersion (version);
275275
276276 for (DTCalibrationMap::const_iterator keyAndCalibs = theCalibFile->keyAndConsts_begin ();
277277 keyAndCalibs != theCalibFile->keyAndConsts_end ();
@@ -288,7 +288,7 @@ void DumpFileToDB::endJob() {
288288 throw cms::Exception (" IncorrectSetup" ) << " Inconsistent version of file" ;
289289
290290 vector<double > params (values.begin () + 11 , values.begin () + 11 + nfields);
291- conds-> set ((*keyAndCalibs).first , params);
291+ conds. set ((*keyAndCalibs).first , params);
292292 DTCalibDBUtils::writeToDB<DTRecoConditions>(" DTRecoConditionsUncertRcd" , conds);
293293 }
294294 }
0 commit comments