1 /*************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercialf purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /* $Id: AliTRDpidRefMakerNN.cxx 27496 2008-07-22 08:35:45Z cblume $ */
18 ////////////////////////////////////////////////////////////////////////////
20 // Builds the reference tree for the training of neural networks //
22 ////////////////////////////////////////////////////////////////////////////
30 #include "TGraphErrors.h"
32 #include "TEventList.h"
33 #include "TMultiLayerPerceptron.h"
36 #include "AliESDtrack.h"
37 #include "AliTrackReference.h"
39 #include "AliTRDtrackV1.h"
40 #include "AliTRDReconstructor.h"
41 #include "AliTRDpidUtil.h"
42 #include "AliTRDpidRefMakerNN.h"
43 #include "AliTRDpidUtil.h"
45 #include "Cal/AliTRDCalPID.h"
46 #include "Cal/AliTRDCalPIDNN.h"
47 #include "info/AliTRDtrackInfo.h"
48 #include "info/AliTRDv0Info.h"
49 #include "info/AliTRDpidInfo.h"
51 ClassImp(AliTRDpidRefMakerNN)
53 //________________________________________________________________________
54 AliTRDpidRefMakerNN::AliTRDpidRefMakerNN()
70 // Default constructor
72 SetNameTitle("PIDrefMakerNN", "PID(NN) Reference Maker");
74 memset(fTrain, 0, AliTRDCalPID::kNMom*sizeof(TEventList*));
75 memset(fTest, 0, AliTRDCalPID::kNMom*sizeof(TEventList*));
76 memset(fTrainData, 0, AliTRDCalPID::kNMom*sizeof(TTree*));
79 SetScaledEdx(Float_t(AliTRDCalPIDNN::kMLPscale));
81 fDate = datime.GetDate();
84 //________________________________________________________________________
85 AliTRDpidRefMakerNN::AliTRDpidRefMakerNN(const char *name)
86 :AliTRDpidRefMaker(name, "PID(NN) Reference Maker")
101 // Default constructor
104 memset(fTrain, 0, AliTRDCalPID::kNMom*sizeof(TEventList*));
105 memset(fTest, 0, AliTRDCalPID::kNMom*sizeof(TEventList*));
106 memset(fTrainData, 0, AliTRDCalPID::kNMom*sizeof(TTree*));
109 SetScaledEdx(Float_t(AliTRDCalPIDNN::kMLPscale));
111 fDate = datime.GetDate();
115 //________________________________________________________________________
116 AliTRDpidRefMakerNN::~AliTRDpidRefMakerNN()
121 //________________________________________________________________________
122 void AliTRDpidRefMakerNN::MakeTrainTestTrees()
124 // Create output file and tree
127 fRef = new TFile("TRD.CalibPIDrefMakerNN.root", "RECREATE");
128 for(Int_t ip = 0; ip < AliTRDCalPID::kNMom; ip++){
129 fTrainData[ip] = new TTree(Form("fTrainData_%d", ip), Form("NN Reference Data for MomBin %d", ip));
130 fTrainData[ip] -> Branch("fdEdx", fdEdx, Form("fdEdx[%d]/F", AliTRDpidUtil::kNNslices));
131 fTrainData[ip] -> Branch("fPID", fPID, Form("fPID[%d]/F", AliPID::kSPECIES));
132 fTrainData[ip] -> Branch("fLy", &fLy, "fLy/I");
133 fTrainData[ip] -> Branch("fNtrkl", &fNtrkl, "fNtrkl/I");
135 fTrain[ip] = new TEventList(Form("fTrainMom%d", ip), Form("Training list for momentum intervall %d", ip));
136 fTest[ip] = new TEventList(Form("fTestMom%d", ip), Form("Test list for momentum intervall %d", ip));
142 //________________________________________________________________________
143 Bool_t AliTRDpidRefMakerNN::PostProcess()
145 // Draw result to the screen
146 // Called once at the end of the query
148 TFile *fCalib = TFile::Open(Form("AnalysisResults.root"));
150 AliError("Calibration file not available");
153 TDirectoryFile *dCalib = (TDirectoryFile*)fCalib->Get("TRD.CalibPIDrefMaker");
155 AliError("Calibration directory not available");
158 fData = (TTree*)dCalib->Get("RefPID");
160 AliError("Calibration data not available");
164 if(!(o = (TObjArray*)dCalib->Get("MonitorNN"))) {
165 AliWarning("Missing monitoring container.");
168 fContainer = (TObjArray*)o->Clone("monitor");
173 AliDebug(2, "Loading file TRD.CalibPIDrefMakerNN.root");
174 LoadFile("TRD.CalibPIDrefMakerNN.root");
176 else AliDebug(2, "file available");
179 MakeTrainingSample();
181 else AliDebug(2, "file available");
184 // build the training and the test list for the neural networks
185 for(Int_t ip = 0; ip < AliTRDCalPID::kNMom; ip++){
186 MakeTrainingLists(ip);
188 if(!fDoTraining) return kTRUE;
192 // train the neural networks
193 gSystem->Exec(Form("mkdir ./Networks_%d/",fDate));
194 AliDebug(2, Form("TrainMomBin [%d] [%d]", fTrainMomBin, kAll));
196 // train single network for a single momentum (recommended)
197 if(!(fTrainMomBin == kAll)){
198 if(fTrain[fTrainMomBin] -> GetN() < fMinTrain){
199 AliError("Warning in AliTRDpidRefMakerNN::PostProcess : Not enough events for training available! Please check Data sample!");
202 MakeRefs(fTrainMomBin);
203 MonitorTraining(fTrainMomBin);
207 for(Int_t iMomBin = 0; iMomBin < AliTRDCalPID::kNMom; iMomBin++){
208 if(fTrain[iMomBin] -> GetN() < fMinTrain){
209 AliError(Form("Warning in AliTRDpidRefMakerNN::PostProcess : Not enough events for training available for momentum bin [%d]! Please check Data sample!", iMomBin));
212 MakeRefs(fTrainMomBin);
213 MonitorTraining(iMomBin);
217 return kTRUE; // testing protection
221 //________________________________________________________________________
222 Bool_t AliTRDpidRefMakerNN::MakeTrainingSample()
225 TFile *fCalib = TFile::Open(Form("AnalysisResults.root"));
227 AliError("Calibration file not available");
230 TDirectoryFile *dCalib = (TDirectoryFile*)fCalib->Get("TRD.CalibPIDrefMaker");
232 AliError("Calibration directory not available");
235 fData = (TTree*)dCalib->Get("RefPID");
237 AliError("Calibration data not available");
241 if(!(o = (TObjArray*)dCalib->Get("MonitorNN"))) {
242 AliWarning("Missing monitoring container.");
245 fContainer = (TObjArray*)o->Clone("monitor");
248 MakeTrainTestTrees();
250 // Convert the CaliPIDrefMaker tree to 11 (different momentum bin) trees for NN training
253 for(Int_t ip=0; ip < AliTRDCalPID::kNMom; ip++){
254 for(Int_t is=0; is < AliPID::kSPECIES; is++) {
255 memset(fPID, 0, AliPID::kSPECIES*sizeof(Float_t));
257 Int_t n(0); // index of data
258 for(Int_t itrk = 0; itrk<fData->GetEntries() && n<kMaxStat; itrk++){
259 if(!(fData->GetEntry(itrk))) continue;
260 if(fPIDdataArray->GetPID()!=is) continue;
261 fNtrkl = fPIDdataArray->GetNtracklets();
262 for(Int_t ily=fPIDdataArray->GetNtracklets(); ily--;){
264 if(fPIDdataArray->GetData(ily)->Momentum()!= ip) continue;
265 memset(fdEdx, 0, AliTRDpidUtil::kNNslices*sizeof(Float_t));
266 for(Int_t islice=AliTRDCalPID::kNSlicesNN; islice--;){
267 fdEdx[islice]+=fPIDdataArray->GetData(ily)->fdEdx[islice];
268 fdEdx[islice]/=fScale;
270 fTrainData[ip] -> Fill();
274 AliDebug(2, Form("%d %d %d", ip, is, n));
280 for(Int_t ip = 0; ip < AliTRDCalPID::kNMom; ip++){
281 fTrainData[ip] -> Write();
286 else AliWarning("Training file available. No conversion done!");
291 //________________________________________________________________________
292 void AliTRDpidRefMakerNN::MakeTrainingLists(Int_t mombin)
295 // build the training lists for the neural networks
299 LoadFile(Form("TRD.Calib%s.root", GetName()));
303 AliError("ERROR file for building training list not available");
307 AliDebug(2, "\n Making training lists! \n");
309 Int_t nPart[AliPID::kSPECIES];
310 memset(nPart, 0, AliPID::kSPECIES*sizeof(Int_t));
312 // set needed branches
313 fTrainData[mombin] -> SetBranchAddress("fdEdx", fdEdx);
314 fTrainData[mombin] -> SetBranchAddress("fPID", fPID);
315 fTrainData[mombin] -> SetBranchAddress("fLy", &fLy);
316 fTrainData[mombin] -> SetBranchAddress("fNtrkl", &fNtrkl);
318 // start first loop to check total number of each particle type
319 for(Int_t iEv=0; iEv < fTrainData[mombin] -> GetEntries(); iEv++){
320 fTrainData[mombin] -> GetEntry(iEv);
322 // use only events with goes through 6 layers TRD
323 if(fNtrkl != AliTRDgeometry::kNlayer) continue;
325 if(fPID[AliPID::kElectron] == 1)
326 nPart[AliPID::kElectron]++;
327 else if(fPID[AliPID::kMuon] == 1)
328 nPart[AliPID::kMuon]++;
329 else if(fPID[AliPID::kPion] == 1)
330 nPart[AliPID::kPion]++;
331 else if(fPID[AliPID::kKaon] == 1)
332 nPart[AliPID::kKaon]++;
333 else if(fPID[AliPID::kProton] == 1)
334 nPart[AliPID::kProton]++;
337 AliDebug(2, "Particle multiplicities:");
338 AliDebug(2, Form("Momentum[%d] Elecs[%d] Muons[%d] Pions[%d] Kaons[%d] Protons[%d]", mombin, nPart[AliPID::kElectron], nPart[AliPID::kMuon], nPart[AliPID::kPion], nPart[AliPID::kKaon], nPart[AliPID::kProton]));
342 // // implement counter of training and test sample size
343 Int_t iTrain = 0, iTest = 0;
345 // set training sample size per momentum interval to 2/3
346 // of smallest particle counter and test sample to 1/3
348 for(Int_t iPart = 1; iPart < AliPID::kSPECIES; iPart++){
349 // exclude muons and kaons if not availyable
350 // this is neeeded since we do not have v0 candiates
351 if((iPart == AliPID::kMuon || iPart == AliPID::kKaon) && (nPart[AliPID::kMuon] == 0 || nPart[AliPID::kKaon] == 0)) continue;
352 if(iTrain > nPart[iPart])
353 iTrain = nPart[iPart];
355 iTest = Int_t( iTrain * (1-fFreq));
356 iTrain = Int_t(iTrain * fFreq);
357 AliDebug(2, Form("Momentum[%d] Train[%d] Test[%d]", mombin, iTrain, iTest));
362 memset(nPart, 0, AliPID::kSPECIES*sizeof(Int_t));
364 // start second loop to set the event lists
365 for(Int_t iEv = 0; iEv < fTrainData[mombin] -> GetEntries(); iEv++){
366 fTrainData[mombin] -> GetEntry(iEv);
369 for(Int_t is = 0; is < AliPID::kSPECIES; is++){
370 if(nPart[is] < iTrain && fPID[is] == 1){
371 fTrain[mombin] -> Enter(iEv);
373 } else if(nPart[is] < iTest+iTrain && fPID[is] == 1){
374 fTest[mombin] -> Enter(iEv);
380 AliDebug(2, "Particle multiplicities in both lists:");
381 AliDebug(2, Form("Momentum[%d] Elecs[%d] Muons[%d] Pions[%d] Kaons[%d] Protons[%d]", mombin, nPart[AliPID::kElectron], nPart[AliPID::kMuon], nPart[AliPID::kPion], nPart[AliPID::kKaon], nPart[AliPID::kProton]));
387 //________________________________________________________________________
388 void AliTRDpidRefMakerNN::MakeRefs(Int_t mombin)
391 // train the neural networks
395 if (!fTrainData[mombin]) LoadFile(Form("TRD.CalibPIDrefMakerNN.root"));
397 if (!fTrainData[mombin]) {
398 AliError("Tree for training list not available");
403 fDate = datime.GetDate();
405 AliDebug(2, Form("Training momentum bin %d", mombin));
407 // set variable to monitor the training and to save the development of the networks
408 Int_t nEpochs = fEpochs/kMoniTrain;
409 AliDebug(2, Form("Training %d times %d epochs", kMoniTrain, nEpochs));
411 // make directories to save the networks
412 gSystem->Exec(Form("rm -r ./Networks_%d/MomBin_%d",fDate, mombin));
413 gSystem->Exec(Form("mkdir ./Networks_%d/MomBin_%d",fDate, mombin));
415 // variable to check if network can load weights from previous training
416 Bool_t bFirstLoop = kTRUE;
418 // train networks over several loops and save them after each loop
419 for(Int_t iLoop = 0; iLoop < kMoniTrain; iLoop++){
420 fTrainData[mombin] -> SetEventList(fTrain[mombin]);
421 fTrainData[mombin] -> SetEventList(fTest[mombin]);
423 AliDebug(2, Form("Momentum[%d] Trainingloop[%d]", mombin, iLoop));
425 // check if network is already implemented
426 if(bFirstLoop == kTRUE){
427 fNet = new TMultiLayerPerceptron("fdEdx[0],fdEdx[1],fdEdx[2],fdEdx[3],fdEdx[4],fdEdx[5],fdEdx[6],fdEdx[7]:15:7:fPID[0],fPID[1],fPID[2],fPID[3],fPID[4]!",fTrainData[mombin],fTrain[mombin],fTest[mombin]);
428 fNet -> SetLearningMethod(TMultiLayerPerceptron::kStochastic); // set learning method
429 fNet -> TMultiLayerPerceptron::SetEta(0.001); // set learning speed
430 if(!fContinueTraining){
431 if(AliLog::GetDebugLevel("","AliTRDpidRefMakerNN")>=2) fNet -> Train(nEpochs,"text update=10, graph");
432 else fNet -> Train(nEpochs,"");
435 fNet -> LoadWeights(Form("./Networks_%d/MomBin_%d/Net_%d",fTrainPath, mombin, kMoniTrain - 1));
436 if(AliLog::GetDebugLevel("","AliTRDpidRefMakerNN")>=2) fNet -> Train(nEpochs,"text update=10, graph+");
437 else fNet -> Train(nEpochs,"+");
442 if(AliLog::GetDebugLevel("","AliTRDpidRefMakerNN")>=2) fNet -> Train(nEpochs,"text update=10, graph+");
443 else fNet -> Train(nEpochs,"+");
446 // save weights for monitoring of the training
447 fNet -> DumpWeights(Form("./Networks_%d/MomBin_%d/Net_%d",fDate, mombin, iLoop));
448 } // end training loop
453 //________________________________________________________________________
454 void AliTRDpidRefMakerNN::MonitorTraining(Int_t mombin)
457 // train the neural networks
460 if (!fTrainData[mombin]) LoadFile(Form("TRD.CalibPIDrefMakerNN.root"));
461 if (!fTrainData[mombin]) {
462 AliError("Tree for training list not available");
466 // init networks and set event list
467 for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){
468 fNet = new TMultiLayerPerceptron("fdEdx[0],fdEdx[1],fdEdx[2],fdEdx[3],fdEdx[4],fdEdx[5],fdEdx[6],fdEdx[7]:15:7:fPID[0],fPID[1],fPID[2],fPID[3],fPID[4]!",fTrainData[mombin],fTrain[mombin],fTest[mombin]);
469 fTrainData[mombin] -> SetEventList(fTrain[mombin]);
470 fTrainData[mombin] -> SetEventList(fTest[mombin]);
473 // implement variables for likelihoods
474 Float_t like[AliPID::kSPECIES][AliTRDgeometry::kNlayer];
475 memset(like, 0, AliPID::kSPECIES*AliTRDgeometry::kNlayer*sizeof(Float_t));
476 Float_t likeAll[AliPID::kSPECIES], totProb;
478 Double_t pionEffiTrain[kMoniTrain], pionEffiErrTrain[kMoniTrain];
479 Double_t pionEffiTest[kMoniTrain], pionEffiErrTest[kMoniTrain];
480 memset(pionEffiTrain, 0, kMoniTrain*sizeof(Double_t));
481 memset(pionEffiErrTrain, 0, kMoniTrain*sizeof(Double_t));
482 memset(pionEffiTest, 0, kMoniTrain*sizeof(Double_t));
483 memset(pionEffiErrTest, 0, kMoniTrain*sizeof(Double_t));
486 const Float_t epsilon = 1/(2*(AliTRDpidUtil::kBins-1)); // get nice histos with bin center at 0 and 1
487 TH1F *hElecs, *hPions;
488 hElecs = new TH1F("hElecs","Likelihood for electrons", AliTRDpidUtil::kBins, 0.-epsilon, 1.+epsilon);
489 hPions = new TH1F("hPions","Likelihood for pions", AliTRDpidUtil::kBins, 0.-epsilon, 1.+epsilon);
491 TGraphErrors *gEffisTrain = new TGraphErrors(kMoniTrain);
492 gEffisTrain -> SetLineColor(4);
493 gEffisTrain -> SetMarkerColor(4);
494 gEffisTrain -> SetMarkerStyle(29);
495 gEffisTrain -> SetMarkerSize(1);
497 TGraphErrors *gEffisTest = new TGraphErrors(kMoniTrain);
498 gEffisTest -> SetLineColor(2);
499 gEffisTest -> SetMarkerColor(2);
500 gEffisTest -> SetMarkerStyle(29);
501 gEffisTest -> SetMarkerSize(1);
503 AliTRDpidUtil *util = new AliTRDpidUtil();
505 // monitor training progress
506 for(Int_t iLoop = 0; iLoop < kMoniTrain; iLoop++){
509 fNet -> LoadWeights(Form("./Networks_%d/MomBin_%d/Net_%d",fDate, mombin, iLoop));
510 AliDebug(2, Form("./Networks_%d/MomBin_%d/Net_%d",fDate, mombin, iLoop));
512 // event loop training list
514 for(Int_t is = 0; is < AliPID::kSPECIES; is++){
516 if(!((is == AliPID::kElectron) || (is == AliPID::kPion))) continue;
519 // reset particle probabilities
520 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
521 likeAll[iPart] = 1./AliPID::kSPECIES;
525 AliDebug(2, Form("%d",fTrain[mombin] -> GetN()));
526 for(Int_t iEvent = 0; iEvent < fTrain[mombin] -> GetN(); iEvent++ ){
527 fTrainData[mombin] -> GetEntry(fTrain[mombin] -> GetEntry(iEvent));
528 // use event only if it is electron or pion
529 if(!(fPID[is] == 1.0)) continue;
530 // get the probabilities for each particle type in each chamber
531 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
532 like[iPart][iChamb] = fNet -> Result(fTrain[mombin] -> GetEntry(iEvent), iPart);
533 likeAll[iPart] *= like[iPart][iChamb];
538 // get total probability and normalize it
539 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
540 totProb += likeAll[iPart];
542 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
543 likeAll[iPart] /= totProb;
547 // fill likelihood distributions
548 if(fPID[AliPID::kElectron] == 1)
549 hElecs -> Fill(likeAll[AliPID::kElectron]);
550 if(fPID[AliPID::kPion] == 1)
551 hPions -> Fill(likeAll[AliPID::kElectron]);
553 // reset particle probabilities
554 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
555 likeAll[iPart] = 1./AliPID::kSPECIES;
560 } // end species loop
563 // calculate the pion efficiency and fill the graph
564 util -> CalculatePionEffi(hElecs, hPions);
565 pionEffiTrain[iLoop] = util -> GetPionEfficiency();
566 pionEffiErrTrain[iLoop] = util -> GetError();
568 gEffisTrain -> SetPoint(iLoop, iLoop+1, pionEffiTrain[iLoop]);
569 gEffisTrain -> SetPointError(iLoop, 0, pionEffiErrTrain[iLoop]);
572 AliDebug(2, Form("TrainingLoop[%d] PionEfficiency[%f +/- %f]", iLoop, pionEffiTrain[iLoop], pionEffiErrTrain[iLoop]));
577 // monitor validation progress
578 for(Int_t is = 0; is < AliPID::kSPECIES; is++){
580 if(!((is == AliPID::kElectron) || (is == AliPID::kPion))) continue;
583 // reset particle probabilities
584 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
585 likeAll[iPart] = 1./AliPID::kSPECIES;
589 for(Int_t iEvent = 0; iEvent < fTest[mombin] -> GetN(); iEvent++ ){
590 fTrainData[mombin] -> GetEntry(fTest[mombin] -> GetEntry(iEvent));
591 // use event only if it is electron or pion
592 if(!(fPID[is] == 1.0)) continue;
594 // get the probabilities for each particle type in each chamber
595 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
596 like[iPart][iChamb] = fNet -> Result(fTest[mombin] -> GetEntry(iEvent), iPart);
597 likeAll[iPart] *= like[iPart][iChamb];
601 // get total probability and normalize it
602 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
603 totProb += likeAll[iPart];
605 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
606 likeAll[iPart] /= totProb;
610 // fill likelihood distributions
611 if(fPID[AliPID::kElectron] == 1)
612 hElecs -> Fill(likeAll[AliPID::kElectron]);
613 if(fPID[AliPID::kPion] == 1)
614 hPions -> Fill(likeAll[AliPID::kElectron]);
616 // reset particle probabilities
617 for(Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++){
618 likeAll[iPart] = 1./AliPID::kSPECIES;
623 } // end species loop
625 // calculate the pion efficiency and fill the graph
626 util -> CalculatePionEffi(hElecs, hPions);
627 pionEffiTest[iLoop] = util -> GetPionEfficiency();
628 pionEffiErrTest[iLoop] = util -> GetError();
630 gEffisTest -> SetPoint(iLoop, iLoop+1, pionEffiTest[iLoop]);
631 gEffisTest -> SetPointError(iLoop, 0, pionEffiErrTest[iLoop]);
634 AliDebug(2, Form("TestLoop[%d] PionEfficiency[%f +/- %f] \n", iLoop, pionEffiTest[iLoop], pionEffiErrTest[iLoop]));
636 } // end validation loop
640 gEffisTest -> Draw("PAL");
641 gEffisTrain -> Draw("PL");
646 //________________________________________________________________________
647 Bool_t AliTRDpidRefMakerNN::LoadFile(const Char_t *InFileNN)
650 // Loads the files and sets the event list
651 // for neural network training.
652 // Useable for training outside of the makeResults.C macro
655 fRef = TFile::Open(Form("%s", InFileNN));
657 for(Int_t ip = 0; ip < AliTRDCalPID::kNMom; ip++){
658 fTrainData[ip] = (TTree*)fRef -> Get(Form("fTrainData_%d", ip));
661 for(Int_t iMom = 0; iMom < AliTRDCalPID::kNMom; iMom++){
662 fTrain[iMom] = new TEventList(Form("fTrainMom%d", iMom), Form("Training list for momentum intervall %d", iMom));
663 fTest[iMom] = new TEventList(Form("fTestMom%d", iMom), Form("Test list for momentum intervall %d", iMom));